/**
 * @license
 * Copyright 2025 Vybestack LLC
 * SPDX-License-Identifier: Apache-2.0
 */
export function toTokenMetricsSnapshot(metrics, usage) {
    return {
        tokensPerMinute: metrics?.tokensPerMinute ?? 0,
        throttleWaitTimeMs: metrics?.throttleWaitTimeMs ?? 0,
        sessionTokenTotal: usage?.total ?? 0,
    };
}
export function shouldUpdateTokenMetrics(previous, metrics, usage) {
    if (!previous) {
        return true;
    }
    const next = toTokenMetricsSnapshot(metrics, usage);
    return (next.tokensPerMinute !== previous.tokensPerMinute ||
        next.throttleWaitTimeMs !== previous.throttleWaitTimeMs ||
        next.sessionTokenTotal !== previous.sessionTokenTotal);
}
//# sourceMappingURL=tokenMetricsTracker.js.map