Skip to content

Commit 46cc537

Browse files
authored
feat: ingestion log state queued (#32)
Signed-off-by: Michal Fiedorowicz <[email protected]>
1 parent 4d14c09 commit 46cc537

File tree

5 files changed

+25
-25
lines changed

5 files changed

+25
-25
lines changed

netbox_diode_plugin/reconciler/sdk/v1/reconciler_pb2.py

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

netbox_diode_plugin/reconciler/sdk/v1/reconciler_pb2.pyi

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ DESCRIPTOR: _descriptor.FileDescriptor
1111
class State(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
1212
__slots__ = ()
1313
UNSPECIFIED: _ClassVar[State]
14-
NEW: _ClassVar[State]
14+
QUEUED: _ClassVar[State]
1515
RECONCILED: _ClassVar[State]
1616
FAILED: _ClassVar[State]
1717
NO_CHANGES: _ClassVar[State]
1818
UNSPECIFIED: State
19-
NEW: State
19+
QUEUED: State
2020
RECONCILED: State
2121
FAILED: State
2222
NO_CHANGES: State
@@ -72,18 +72,18 @@ class IngestionError(_message.Message):
7272
def __init__(self, message: _Optional[str] = ..., code: _Optional[int] = ..., details: _Optional[_Union[IngestionError.Details, _Mapping]] = ...) -> None: ...
7373

7474
class IngestionMetrics(_message.Message):
75-
__slots__ = ("total", "new", "reconciled", "failed", "no_changes")
75+
__slots__ = ("total", "queued", "reconciled", "failed", "no_changes")
7676
TOTAL_FIELD_NUMBER: _ClassVar[int]
77-
NEW_FIELD_NUMBER: _ClassVar[int]
77+
QUEUED_FIELD_NUMBER: _ClassVar[int]
7878
RECONCILED_FIELD_NUMBER: _ClassVar[int]
7979
FAILED_FIELD_NUMBER: _ClassVar[int]
8080
NO_CHANGES_FIELD_NUMBER: _ClassVar[int]
8181
total: int
82-
new: int
82+
queued: int
8383
reconciled: int
8484
failed: int
8585
no_changes: int
86-
def __init__(self, total: _Optional[int] = ..., new: _Optional[int] = ..., reconciled: _Optional[int] = ..., failed: _Optional[int] = ..., no_changes: _Optional[int] = ...) -> None: ...
86+
def __init__(self, total: _Optional[int] = ..., queued: _Optional[int] = ..., reconciled: _Optional[int] = ..., failed: _Optional[int] = ..., no_changes: _Optional[int] = ...) -> None: ...
8787

8888
class ChangeSet(_message.Message):
8989
__slots__ = ("id", "data")

netbox_diode_plugin/templates/diode/ingestion_logs.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ <h4 class="alert-heading">{% trans "Error" %}</h4>
1919
<div class="card p-3">
2020
<div class="row d-flex flex-wrap justify-content-evenly">
2121
<div class="w-auto p-0">
22-
<canvas id="ingestions-new"></canvas>
23-
<div class="text-center metric-label">New</div>
22+
<canvas id="ingestions-queued"></canvas>
23+
<div class="text-center metric-label">Queued</div>
2424
</div>
2525
<div class="w-auto p-0">
2626
<canvas id="ingestions-reconciled"></canvas>
@@ -105,7 +105,7 @@ <h4 class="alert-heading">{% trans "Error" %}</h4>
105105

106106
document.addEventListener('DOMContentLoaded', function() {
107107
function redrawMetrics() {
108-
drawGauge(document.getElementById('ingestions-new').getContext('2d'), {{ ingestion_metrics.new }}, '#FFFF00');
108+
drawGauge(document.getElementById('ingestions-queued').getContext('2d'), {{ ingestion_metrics.queued }}, '#FFFF00');
109109
drawGauge(document.getElementById('ingestions-reconciled').getContext('2d'), {{ ingestion_metrics.reconciled }}, '#4CAF50');
110110
drawGauge(document.getElementById('ingestions-failed').getContext('2d'), {{ ingestion_metrics.failed }}, '#FF0000');
111111
drawGauge(document.getElementById('ingestions-no-changes').getContext('2d'), {{ ingestion_metrics.no_changes }}, '#40E0D0');

netbox_diode_plugin/tests/test_views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def test_cached_metrics(self):
143143
cache.set(
144144
"ingestion_metrics",
145145
{
146-
"new": 10,
146+
"queued": 10,
147147
"reconciled": 20,
148148
"failed": 5,
149149
"no_changes": 65,

netbox_diode_plugin/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def get(self, request):
6262
only_metrics=True
6363
)
6464
metrics = {
65-
"new": ingestion_metrics.metrics.new or 0,
65+
"queued": ingestion_metrics.metrics.queued or 0,
6666
"reconciled": ingestion_metrics.metrics.reconciled or 0,
6767
"failed": ingestion_metrics.metrics.failed or 0,
6868
"no_changes": ingestion_metrics.metrics.no_changes or 0,

0 commit comments

Comments
 (0)