Skip to content

Commit

Permalink
Merge pull request #50 from CybercentreCanada/hotfix/ingester_busyness
Browse files Browse the repository at this point in the history
Hotfix/ingester busyness (dev)
  • Loading branch information
cccs-sgaron authored Apr 7, 2021
2 parents 5790ff7 + ec5adcb commit 8fe8420
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions src/components/routes/dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const WrappedIngestCard = ({ ingester }) => {
const [timer, setTimer] = useState(null);
const [error, setError] = useState(null);
const classes = useStyles();
const busyness = (ingester.metrics.busy_seconds * ingester.metrics.busy_seconds_count) / ingester.instances / 60;
const busyness = (ingester.metrics.cpu_seconds * ingester.metrics.cpu_seconds_count) / ingester.instances / 60;

useEffect(() => {
if (ingester.processing_chance.critical !== 1) {
Expand Down Expand Up @@ -146,25 +146,41 @@ const WrappedIngestCard = ({ ingester }) => {
<div>
<MetricCounter
init={ingester.initialized}
value={ingester.queues.critical}
value={
ingester.processing_chance.critical === 1
? ingester.queues.critical
: `${ingester.queues.critical} (${Math.round(ingester.processing_chance.critical * 100)}%)`
}
title="C"
tooltip={t('ingest.critical')}
/>
<MetricCounter
init={ingester.initialized}
value={ingester.queues.high}
value={
ingester.processing_chance.high === 1
? ingester.queues.high
: `${ingester.queues.high} (${Math.round(ingester.processing_chance.high * 100)}%)`
}
title="H"
tooltip={t('ingest.high')}
/>
<MetricCounter
init={ingester.initialized}
value={ingester.queues.medium}
value={
ingester.processing_chance.medium === 1
? ingester.queues.medium
: `${ingester.queues.medium} (${Math.round(ingester.processing_chance.medium * 100)}%)`
}
title="M"
tooltip={t('ingest.medium')}
/>
<MetricCounter
init={ingester.initialized}
value={ingester.queues.low}
value={
ingester.processing_chance.low === 1
? ingester.queues.low
: `${ingester.queues.low} (${Math.round(ingester.processing_chance.low * 100)}%)`
}
title="L"
tooltip={t('ingest.low')}
/>
Expand Down Expand Up @@ -923,6 +939,8 @@ const DEFAULT_INGESTER = {
cache_stale: 0,
cache_hit_local: 0,
cache_hit: 0,
cpu_seconds: 0,
cpu_seconds_count: 0,
bytes_completed: 0,
bytes_ingested: 0,
duplicates: 0,
Expand Down

0 comments on commit 8fe8420

Please sign in to comment.