diff --git a/core/client.js b/core/client.js index e23a7527..702be90a 100644 --- a/core/client.js +++ b/core/client.js @@ -133,7 +133,7 @@ class TfNavigationElement extends LitElement { ${this.status.message} ${this.render_permissions()} - ${Object.values(this.spark_lines)} + ${Object.keys(this.spark_lines).sort().map(x => this.spark_lines[x]).map(x => [x.dataset.emoji, x])} ${this.render_login()} @@ -250,7 +250,7 @@ class TfSparkLineElement extends LitElement { render_line(line) { if (line?.values?.length >= 2) { - let points = [].concat(...line.values.map((x, i) => [i * 100 / (line.values.length - 1), 10 - 10 * (x - this.min) / (this.max - this.min)])); + let points = [].concat(...line.values.map((x, i) => [100.0 * i / (line.values.length - 1), 10.0 - 10.0 * (x - this.min) / (this.max - this.min)])); return svg` `; @@ -259,7 +259,7 @@ class TfSparkLineElement extends LitElement { render() { return html` - + ${this.lines.map(x => this.render_line(x))} `; @@ -741,8 +741,8 @@ function _receive_websocket_message(message) { tls_malloc_percent: {group: 'memory', name: 'tls'}, uv_malloc_percent: {group: 'memory', name: 'uv'}, - messages_stored: {group: 'stored', name: 'messages'}, - blobs_stored: {group: 'stored', name: 'blobs'}, + messages_stored: {group: 'store', name: 'messages'}, + blobs_stored: {group: 'store', name: 'blobs'}, socket_count: {group: 'socket', name: 'total'}, socket_open_count: {group: 'socket', name: 'open'}, @@ -803,8 +803,14 @@ function _receive_websocket_message(message) { } timeseries.append(now, message.stats[key]); - if (graph_key == 'cpu' || graph_key == 'rpc' || graph_key == 'stored') { - document.getElementsByTagName('tf-navigation')[0].get_spark_line(graph_key, { max: 100 }).append(key, message.stats[key]); + if (graph_key == 'cpu' || graph_key == 'rpc' || graph_key == 'store') { + let line = document.getElementsByTagName('tf-navigation')[0].get_spark_line(graph_key, { max: 100 }); + line.dataset.emoji = { + 'cpu': '💻', + 'rpc': '🔁', + 'store': '💾', + }[graph_key]; + line.append(key, message.stats[key]); } } } else if (message &&