ruvector/examples/edge-net/sim/dist/metrics.d.ts
rUv 383c791101 feat(edge-net): add Pi-Key crypto, lifecycle simulation, optimizations
- Add Pi-Key WASM cryptographic module with mathematical constant sizing
  - Pi-sized (314 bits/40 bytes) identity keys
  - Euler-sized (271 bits/34 bytes) session keys
  - Phi-sized (161 bits/21 bytes) genesis keys
  - Ed25519 signing + AES-256-GCM encryption

- Add comprehensive TypeScript lifecycle simulation (sim/)
  - 6 source files, 1,420 lines
  - Validates all 4 phases: Genesis → Growth → Maturation → Independence
  - Economic sustainability and phase transition testing

- Performance optimizations
  - FxHashMap for 30-50% faster lookups in evolution/mod.rs
  - VecDeque for O(1) front removal
  - Batched Q-learning updates in security/mod.rs
  - Fixed borrow checker error in process_batch_updates()

- Add benchmarks and documentation
  - BENCHMARKS.md with performance metrics
  - PERFORMANCE_OPTIMIZATIONS.md with details
  - docs/FINAL_REPORT.md comprehensive summary

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 01:29:11 +00:00

88 lines
No EOL
2 KiB
TypeScript

/**
* Metrics Collection and Aggregation
* Tracks network performance across all phases
*/
import { Network, NetworkPhase } from './network.js';
export interface PhaseMetrics {
phase: NetworkPhase;
startTick: number;
endTick: number;
duration: number;
nodeCount: {
start: number;
end: number;
peak: number;
};
energy: {
totalEarned: number;
totalSpent: number;
netEnergy: number;
avgPerNode: number;
sustainability: number;
};
genesis: {
avgMultiplier: number;
activeCount: number;
readOnlyCount: number;
retiredCount: number;
};
network: {
avgConnections: number;
avgSuccessRate: number;
taskThroughput: number;
tasksCompleted: number;
};
validation: {
passed: boolean;
reasons: string[];
};
}
export declare class MetricsCollector {
private network;
private phaseMetrics;
private currentPhaseStart;
private currentPhaseNodeCount;
private peakNodeCount;
constructor(network: Network);
/**
* Initialize metrics collection
*/
initialize(): void;
/**
* Collect metrics for the current tick
*/
collect(): void;
/**
* Handle phase transition
*/
onPhaseTransition(oldPhase: NetworkPhase, newPhase: NetworkPhase): void;
/**
* Finalize metrics for a completed phase
*/
private finalizePhase;
/**
* Validate phase completion criteria
*/
private validatePhase;
/**
* Finalize current phase (for end of simulation)
*/
finalizeCurrent(): void;
/**
* Get all collected metrics
*/
getAllMetrics(): PhaseMetrics[];
/**
* Get metrics for a specific phase
*/
getPhaseMetrics(phase: NetworkPhase): PhaseMetrics | undefined;
/**
* Get overall success rate
*/
getOverallSuccess(): {
passed: boolean;
totalPassed: number;
totalPhases: number;
};
}
//# sourceMappingURL=metrics.d.ts.map