Skip to content

Commit

Permalink
Added "Online clients" information.
Browse files Browse the repository at this point in the history
  • Loading branch information
petersirka committed Apr 30, 2024
1 parent b752b83 commit b1e9df4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion public/css/default.css
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ header label span { display: block; color: #999; font-size: 11px; font-weight: n

.landing .listing .icon { float: left; width: 50px; height: 50px; font-size: 25px; }
.landing footer { height: 30px; background-color: #FFF; line-height: 30px; padding: 0; font-size: 11px; border-top: 1px solid #E0E0E0; }
.landing footer span { float: left; padding: 0 0 0 10px; width: 20%; }
.landing footer span { float: left; padding: 0 0 0 10px; width: 16%; }
.landing footer span b { float: right; border-right: 1px solid #E0E0E0; padding-right: 10px; }
.landing footer span:last-child b { border-right: 0; }

Expand Down
1 change: 1 addition & 0 deletions public/parts/flows.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
<span><b>{{ value.messages | format(0) }}</b>@(Messages)</span>
<span><b>{{ value.pending | format(0) }}</b>@(Pending)</span>
<span><b>{{ value.mm | format(0) }}</b>@(Per minute)</span>
<span><i class="ti ti-user green mr5"></i><b>{{ value.online | format(0) }}</b>@(Online clients)</span>
<span class="center" title="FlowStream: {{ value.version }}, Total.js: {{ value.total }}, Node.js: {{ value.node }}">FlowStream v{{ value.version }} | Total.js: v{{ value.total }}</span>
</script>
</ui-bind>
Expand Down
9 changes: 7 additions & 2 deletions schemas/streams.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,13 @@ NEWACTION('Streams/stats', {
internalstats.mm = 0;
internalstats.memory = process.memoryUsage().heapUsed;

for (var key in Flow.instances) {
var flow = Flow.instances[key];
internalstats.online = 0;

for (let key in Total.connections)
internalstats.online += Total.connections[key].online;

for (let key in Flow.instances) {
let flow = Flow.instances[key];
if (flow.flow && flow.flow.stats) {
internalstats.messages += flow.flow.stats.messages;
internalstats.mm += flow.flow.stats.mm;
Expand Down

0 comments on commit b1e9df4

Please sign in to comment.