use ms for start time in status files

This commit is contained in:
Jonathan Shook 2024-01-11 00:41:16 -06:00
parent 8d8288e2eb
commit f6444c4509
2 changed files with 9 additions and 1 deletions

View File

@ -38,7 +38,7 @@ public class NBBaseComponent extends NBBaseComponentMetrics implements NBCompone
protected boolean bufferOrphanedMetrics = false; protected boolean bufferOrphanedMetrics = false;
private ConcurrentHashMap<String,String> props = new ConcurrentHashMap<>(); private ConcurrentHashMap<String,String> props = new ConcurrentHashMap<>();
protected Exception error; protected Exception error;
protected long started_ns, teardown_ns, closed_ns, errored_ns; protected long started_ns, teardown_ns, closed_ns, errored_ns, started_epoch_ms;
protected NBInvokableState state = NBInvokableState.STARTING; protected NBInvokableState state = NBInvokableState.STARTING;
public NBBaseComponent(NBComponent parentComponent) { public NBBaseComponent(NBComponent parentComponent) {
@ -47,6 +47,7 @@ public class NBBaseComponent extends NBBaseComponentMetrics implements NBCompone
public NBBaseComponent(NBComponent parentComponent, NBLabels componentSpecificLabelsOnly) { public NBBaseComponent(NBComponent parentComponent, NBLabels componentSpecificLabelsOnly) {
this.started_ns = System.nanoTime(); this.started_ns = System.nanoTime();
this.started_epoch_ms = System.currentTimeMillis();
this.labels = componentSpecificLabelsOnly; this.labels = componentSpecificLabelsOnly;
if (parentComponent != null) { if (parentComponent != null) {
parent = parentComponent; parent = parentComponent;
@ -296,4 +297,9 @@ public class NBBaseComponent extends NBBaseComponentMetrics implements NBCompone
public long nanosof_error() { public long nanosof_error() {
return this.errored_ns; return this.errored_ns;
} }
@Override
public long started_epoch_ms() {
return this.started_epoch_ms;
}
} }

View File

@ -47,4 +47,6 @@ public interface NBComponentTimeline {
* @return nanosecond time of the error * @return nanosecond time of the error
*/ */
long nanosof_error(); long nanosof_error();
long started_epoch_ms();
} }