mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
add timestamp to inspector request stats (#25667)
* add timestamp to inspector request stats * remove if wrapper, internationalize
This commit is contained in:
parent
8f871f941c
commit
13eccd522a
1 changed files with 13 additions and 0 deletions
|
@ -17,6 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { Request, RequestStatistics, RequestStatus, Response } from './types';
|
||||
|
||||
/**
|
||||
|
@ -43,6 +44,18 @@ export class RequestResponder {
|
|||
...(this.request.stats || {}),
|
||||
...stats,
|
||||
};
|
||||
|
||||
const startDate = new Date(this.request.startTime);
|
||||
const timestampKey = i18n.translate('common.ui.inspector.reqTimestampKey', {
|
||||
defaultMessage: 'Request timestamp',
|
||||
});
|
||||
this.request.stats[timestampKey] = {
|
||||
value: startDate.toISOString(),
|
||||
description: i18n.translate('common.ui.inspector.reqTimestampDescription', {
|
||||
defaultMessage: 'Time when the start of the request has been logged',
|
||||
}),
|
||||
};
|
||||
|
||||
this.onChange();
|
||||
return this;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue