Commit f9d7db22 authored by Andrei Mihu's avatar Andrei Mihu
Browse files

Correctly display counters on console status page.

parent 54767612
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -4,6 +4,8 @@ All notable changes to this project are documented below.
The format is based on [keep a changelog](http://keepachangelog.com) and this project uses [semantic versioning](http://semver.org).

## [Unreleased]
### Fixed
- Correctly display counters on console status page.

## [2.5.0] - 2019-04-25
### Added
+17 −17

File changed.

Preview size limit exceeded, changes collapsed.

+6 −6
Original line number Diff line number Diff line
@@ -264,13 +264,13 @@ class Status extends Component<Props, State> {
    const cfg_output_kbs = this.generate_cfg('output_kbs');

    const total_sessions = data.nodes
      .map(n => n.sessions || 0)
      .map(n => n.session_count || 0)
      .reduce((total, value) => total + value, 0);
    const total_presences = data.nodes
      .map(n => n.presences || 0)
      .map(n => n.presence_count || 0)
      .reduce((total, value) => total + value, 0);
    const total_authoritative_matches = data.nodes
      .map(n => n.authoritative_matches || 0)
      .map(n => n.match_count || 0)
      .reduce((total, value) => total + value, 0);
    const total_goroutine_count = data.nodes
      .map(n => n.goroutine_count || 0)
@@ -347,9 +347,9 @@ class Status extends Component<Props, State> {
                      data.nodes.map((n, key) =>
                        <Table.Row key={`cell_${key}`}>
                          <Table.Cell>{n.name}</Table.Cell>
                          <Table.Cell>{n.sessions || 0}</Table.Cell>
                          <Table.Cell>{n.presences || 0}</Table.Cell>
                          <Table.Cell>{n.authoritative_matches || 0}</Table.Cell>
                          <Table.Cell>{n.session_count || 0}</Table.Cell>
                          <Table.Cell>{n.presence_count || 0}</Table.Cell>
                          <Table.Cell>{n.match_count || 0}</Table.Cell>
                          <Table.Cell>{n.goroutine_count || 0}</Table.Cell>
                        </Table.Row>
                      )
+3 −3
Original line number Diff line number Diff line
export interface Node
{
  name: string,
  sessions?: number,
  presences?: number,
  authoritative_matches?: number,
  session_count?: number,
  presence_count?: number,
  match_count?: number,
  goroutine_count?: number,
  avg_latency_ms: number,
  avg_rate_sec: number,