Kathy Fixes (#864)

* correction

* Fix timeout handling

* kathy metric init

* cleanup
trevor/deploy-relayer-funder-multi-context
Mattie Conover 2 years ago committed by GitHub
parent 42d7d7aed0
commit c34e6193df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      typescript/infra/helm/helloworld-kathy/templates/stateful-set.yaml
  2. 9
      typescript/infra/scripts/helloworld/kathy.ts
  3. 2
      typescript/utils/src/utils.ts

@ -15,6 +15,9 @@ spec:
template:
metadata:
labels: *metadata_labels
annotations:
prometheus.io/port: "9090"
prometheus.io/scrape: "true"
spec:
containers:
- name: helloworld-kathy

@ -116,6 +116,15 @@ async function main() {
});
}, sendFrequency);
// init the metrics because it can take a while for kathy to get through everything and we do not
// want the metrics to be reported as null in the meantime.
for (const { origin, destination: remote } of pairings) {
messagesSendCount.labels({ origin, remote, status: 'success' }).inc(0);
messagesSendCount.labels({ origin, remote, status: 'failure' }).inc(0);
messageSendSeconds.labels({ origin, remote }).inc(0);
messageReceiptSeconds.labels({ origin, remote }).inc(0);
}
for (
// in case we are restarting kathy, keep it from always running the exact same messages first
let currentPairingIndex = Date.now() % pairings.length;

@ -181,7 +181,7 @@ export function timeout<T>(
if (!timeoutMs || timeoutMs <= 0) return promise;
return new Promise((resolve, reject) => {
setTimeout(() => {
throw new Error(message);
reject(new Error(message));
}, timeoutMs);
promise.then(resolve).catch(reject);
});

Loading…
Cancel
Save