Skip to content

Commit

Permalink
change update frequency, move some logs to debug
Browse files Browse the repository at this point in the history
  • Loading branch information
SathyaBhat committed Dec 19, 2023
1 parent 4bd3434 commit de332f1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/collectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class YNABCollector {
help: "Account Cleared Balance amounts",
labelNames: accountLabels,
collect: async () => {
console.log(`Collecting Cleared Balance for ${this.accountBalances.length} accounts`);
console.debug(`Collecting Cleared Balance for ${this.accountBalances.length} accounts`);
this.accountBalances.forEach(a => {
accountClearedBalanceGauge.labels({account_name: a.name, type: a.type, closed: String(a.closed)}).set(a.cleared_balance / 1000);
});
Expand All @@ -27,7 +27,7 @@ export class YNABCollector {
registers: [register],
labelNames: accountLabels,
collect: async () => {
console.log(`Collecting Uncleared Balance for ${this.accountBalances.length} accounts`);
console.debug(`Collecting Uncleared Balance for ${this.accountBalances.length} accounts`);
this.accountBalances.forEach(a => {
accountUnClearedBalanceGauge.labels({account_name: a.name, type: a.type, closed: String(a.closed)}).set(a.uncleared_balance / 1000);
});
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ async function main() {
const ynabCollector = new YNABCollector();

new CronJob({
cronTime: "0 * * * * ",
cronTime: "*/15 * * * *",
onTick: async () => {
ynabCollector.accountBalances = (await scheduledAccountBalanceUpdate(ynab)).accounts;
console.log(`${ynabCollector.accountBalances.length} accounts refreshed`);
Expand All @@ -35,7 +35,7 @@ async function main() {

app.get('/metrics', async (req: Request, res: Response) => {
res.setHeader('Content-Type', register.contentType);
console.log('getting metrics');
console.debug('getting metrics');
const results = await register.metrics();
res.send(results);
});
Expand Down

0 comments on commit de332f1

Please sign in to comment.