Skip to content

Commit 4a0eff8

Browse files
committed
initial commit of ps + buc web client
1 parent 6e7dab4 commit 4a0eff8

16 files changed

Lines changed: 2773 additions & 782 deletions

E2ETests/README.md

Lines changed: 277 additions & 277 deletions
Large diffs are not rendered by default.

E2ETests/tests/metrics-pipeline.test.ts

Lines changed: 260 additions & 260 deletions
Large diffs are not rendered by default.

Web/metrics-client/dist/metrics-collection.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export class MetricsCollection {
3636
* @param statValue - The numeric value
3737
* @param description - Optional description (defaults to stat name)
3838
*/
39-
pushStat(statName, statValue, description) {
39+
storeStat(statName, statValue, description) {
4040
const formattedName = formatMetricName(statName);
4141
this.metrics[formattedName] = {
4242
description: description || statName,
@@ -50,7 +50,7 @@ export class MetricsCollection {
5050
* @param statValue - The numeric value
5151
* @param description - Optional description (defaults to stat name)
5252
*/
53-
pushStatByGroup(groupName, statName, statValue, description) {
53+
storeStatByGroup(groupName, statName, statValue, description) {
5454
const formattedName = formatMetricName(statName);
5555
const existing = this.metrics[formattedName];
5656
if (!existing || !('value' in existing && Array.isArray(existing.value))) {

Web/metrics-client/examples/basic.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ async function main() {
2020
console.log('Creating sample metrics...');
2121

2222
// Add some single-value metrics
23-
metrics.pushStat('fps', 60, 'Frames Per Second');
24-
metrics.pushStat('frame_time', 16.67, 'Frame Time in milliseconds');
25-
metrics.pushStat('memory_used', 512.5, 'Memory Usage in MB');
26-
metrics.pushStat('cpu_usage', 45.3, 'CPU Usage Percentage');
23+
metrics.storeStat('fps', 60, 'Frames Per Second');
24+
metrics.storeStat('frame_time', 16.67, 'Frame Time in milliseconds');
25+
metrics.storeStat('memory_used', 512.5, 'Memory Usage in MB');
26+
metrics.storeStat('cpu_usage', 45.3, 'CPU Usage Percentage');
2727

2828
// Add grouped metrics (simulating multiple players)
2929
const players = ['player0', 'player1', 'player2'];
3030
players.forEach((player, index) => {
31-
metrics.pushStatByGroup(player, 'score', (index + 1) * 1000, 'Player Score');
32-
metrics.pushStatByGroup(player, 'ping', 20 + index * 10, 'Player Ping in ms');
33-
metrics.pushStatByGroup(player, 'health', 100 - index * 10, 'Player Health');
31+
metrics.storeStatByGroup(player, 'score', (index + 1) * 1000, 'Player Score');
32+
metrics.storeStatByGroup(player, 'ping', 20 + index * 10, 'Player Ping in ms');
33+
metrics.storeStatByGroup(player, 'health', 100 - index * 10, 'Player Health');
3434
});
3535

3636
// Display the JSON payload

Web/metrics-client/src/metrics-collection.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export class MetricsCollection {
6565
* @param statValue - The numeric value
6666
* @param description - Optional description (defaults to stat name)
6767
*/
68-
pushStat(statName: string, statValue: number, description?: string): void {
68+
storeStat(statName: string, statValue: number, description?: string): void {
6969
const formattedName = formatMetricName(statName);
7070
this.metrics[formattedName] = {
7171
description: description || statName,
@@ -80,7 +80,7 @@ export class MetricsCollection {
8080
* @param statValue - The numeric value
8181
* @param description - Optional description (defaults to stat name)
8282
*/
83-
pushStatByGroup(groupName: string, statName: string, statValue: number, description?: string): void {
83+
storeStatByGroup(groupName: string, statName: string, statValue: number, description?: string): void {
8484
const formattedName = formatMetricName(statName);
8585
const existing = this.metrics[formattedName];
8686

0 commit comments

Comments
 (0)