Commit 2daaed68 authored by Heinz N. Gies's avatar Heinz N. Gies

Improve display

parent 9693a4a7
......@@ -38,7 +38,7 @@
<form id="queryfrom" action="/events" method="get">
<div class="row">
<div class="large-4 columns">
<input type="text" id="bucket" name="bucket" value="" placeholder="Bucket"/>
<input type="text" id="bucket" name="bucket" value="" placeholderb="Bucket"/>
</div>
<div class="large-4 columns">
<input type="text" id="start" name="start" value="" placeholder="Start date"/>
......@@ -47,7 +47,6 @@
<input type="text" id="end" name="end" value="" placeholder="End date"/>
</div>
</div>
<div class="row">
<div class="large-10 columns">
<input type="text" id="filter" name="filter" value="" placeholder="Filter"/>
......@@ -57,6 +56,11 @@
</div>
</div>
</form>
<div class="row">
<div class="large-12 columns">
Returned <span id="count"></span> events in <span id="time"></span>.
</div>
</div>
<div class="row">
<div class="large-12 columns">
<table>
......
......@@ -16,10 +16,15 @@ $(function() {
msgpack.download(
"", {header: {accept:"application/x-msgpack"}},
function(d) {
d.forEach(function(e) {
$("#time").text((d.t / 1000) + "ms");
$("#count").text(d.e.length);
d.e.forEach(function(e) {
var date = new Date(e.timestamp/1000/1000);
$("#events").append("<tr><td>" + date +
"</td><td>" + JSON.stringify(e.event) + "</td></tr>")
var row = "<tr>" +
"<td>" + date + "</td>" +
"<td><pre>" + JSON.stringify(e.event, null, 2) + "</pre></td>" + +
"</tr>";
$("#events").append(row)
})
})
})
......@@ -52,9 +52,14 @@ handle(Req, State) ->
Start = erlang:convert_time_unit(StartSec, seconds, nano_seconds),
EndSec = qdate:to_unixtime(EndS),
End = erlang:convert_time_unit(EndSec, seconds, nano_seconds),
{ok, Es} = ddb_connection:read_events(Bucket, Start, End, Filter),
Es1 = [[{<<"timestamp">>, T}, {<<"event">>, E}] ||
{T, E} <- Es],
{QT, {ok, Es}} =
timer:tc(ddb_connection, read_events,
[Bucket, Start, End, Filter]),
Es1 = #{
t => QT,
e => [#{timestamp => T, event => E} ||
{T, E} <- Es]
},
dalmatiner_idx_handler:send(ContentType, Es1, Req4, State)
end.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment