commit ff8cd80798bcea5dda1429d27cdfc124c57a7cbe
parent f04c2049796eb7d74106b7c8f720351230694357
Author: Florian Dold <florian@dold.me>
Date: Wed, 28 Jan 2026 22:58:41 +0100
add testing prefix to getPerformanceStats, add stats to CLI via TALER_WALLET_STATS
Diffstat:
3 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/packages/taler-wallet-cli/src/index.ts b/packages/taler-wallet-cli/src/index.ts
@@ -330,7 +330,9 @@ async function createLocalWallet(
lazyTaskLoop: args.lazyTaskLoop,
testing: {
devModeActive: checkEnvFlag("TALER_WALLET_DEV_MODE"),
- emitObservabilityEvents: observabilityEventFile != null,
+ emitObservabilityEvents:
+ observabilityEventFile != null ||
+ checkEnvFlag("TALER_WALLET_STATS"),
skipDefaults: walletCliArgs.wallet.skipDefaults,
},
features: {
@@ -418,12 +420,18 @@ async function withWallet<T>(
};
const result = await f(ctx);
await wh.wallet.client.call(WalletApiOperation.Shutdown, {});
- if (process.env.TALER_WALLET_DBSTATS) {
+ if (process.env.TALER_WALLET_STATS) {
console.log("database stats:");
- const stats = await wh.wallet.client.call(
+ const dbStats = await wh.wallet.client.call(
WalletApiOperation.TestingGetDbStats,
{},
);
+ console.log(j2s(dbStats));
+ console.log("observability stats:");
+ const stats = await wh.wallet.client.call(
+ WalletApiOperation.TestingGetPerformanceStats,
+ {},
+ );
console.log(j2s(stats));
}
return result;
diff --git a/packages/taler-wallet-core/src/wallet-api-types.ts b/packages/taler-wallet-core/src/wallet-api-types.ts
@@ -322,7 +322,6 @@ export enum WalletApiOperation {
GetBankingChoicesForPayto = "getBankingChoicesForPayto",
ConvertIbanAccountFieldToPayto = "convertIbanAccountFieldToPayto",
ConvertIbanPaytoToAccountField = "convertIbanPaytoToAccountField",
- GetPerformanceStats = "getPerformanceStats",
// Tokens and token families
ListDiscounts = "listDiscounts",
@@ -370,6 +369,7 @@ export enum WalletApiOperation {
TestingPlanMigrateExchangeBaseUrl = "testingPlanMigrateExchangeBaseUrl",
TestingRunFixup = "testingRunFixup",
TestingGetDiagnostics = "testingGetDiagnostics",
+ TestingGetPerformanceStats = "testingGetPerformanceStats",
// Hints
@@ -1508,7 +1508,7 @@ export type GetActiveTasksOp = {
};
export type GetPerformanceStatsOp = {
- op: WalletApiOperation.GetPerformanceStats;
+ op: WalletApiOperation.TestingGetPerformanceStats;
request: GetPerformanceStatsRequest;
response: GetPerformanceStatsResponse;
};
@@ -1794,7 +1794,7 @@ export type WalletOperations = {
[WalletApiOperation.ConvertIbanAccountFieldToPayto]: ConvertIbanAccountFieldToPaytoOp;
[WalletApiOperation.ConvertIbanPaytoToAccountField]: ConvertIbanPaytoToAccountFieldOp;
[WalletApiOperation.TestingGetDiagnostics]: TestingGetDiagnosticsOp;
- [WalletApiOperation.GetPerformanceStats]: GetPerformanceStatsOp;
+ [WalletApiOperation.TestingGetPerformanceStats]: GetPerformanceStatsOp;
};
export type WalletCoreRequestType<
diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts
@@ -2092,7 +2092,7 @@ const handlers: { [T in WalletApiOperation]: HandlerWithValidator<T> } = {
codec: codecForConvertIbanPaytoToAccountFieldRequest(),
handler: handleConvertIbanPaytoToAccountField,
},
- [WalletApiOperation.GetPerformanceStats]: {
+ [WalletApiOperation.TestingGetPerformanceStats]: {
codec: codecForEmptyObject(),
handler: handleGetPerformanceStats,
},