Updates realtime-advanced demo

This commit is contained in:
Manu Mtz-Almeida
2015-05-13 16:44:44 +02:00
parent 9386d78673
commit 1f11541011
7 changed files with 263 additions and 25 deletions

View File

@ -46,6 +46,18 @@ function StartEpoch(timestamp) {
{values: defaultData}
]
});
if($('#messagesChart').length ) {
window.messagesChart = $('#messagesChart').epoch({
type: 'time.area',
axes: ['bottom', 'left'],
height: 250,
data: [
{values: defaultData},
{values: defaultData}
]
});
}
}
function StartSSE(roomid) {
@ -63,6 +75,9 @@ function stats(e) {
heapChart.push(data.heap)
mallocsChart.push(data.mallocs)
goroutinesChart.push(data.goroutines)
if(messagesChart) {
messagesChart.push(data.messages)
}
}
function parseJSONStats(e) {
@ -78,13 +93,18 @@ function parseJSONStats(e) {
{time: timestamp, y: data.Mallocs},
{time: timestamp, y: data.Frees}
];
var messages = [
{time: timestamp, y: data.Inbound},
{time: timestamp, y: data.Outbound}
];
var goroutines = [
{time: timestamp, y: data.NuGoroutines},
]
return {
heap: heap,
mallocs: mallocs,
goroutines: goroutines
goroutines: goroutines,
messages: messages
}
}