mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[APM] Fix agent marks (#25717)
* [APM] Fix agent marks * Address feedback
This commit is contained in:
parent
aca61f3fd7
commit
83d5a7a147
3 changed files with 10 additions and 3 deletions
|
@ -8,7 +8,7 @@ import { Transaction } from 'x-pack/plugins/apm/typings/Transaction';
|
|||
import { getAgentMarks } from './get_agent_marks';
|
||||
|
||||
describe('getAgentMarks', () => {
|
||||
it('should sort the marks', () => {
|
||||
it('should sort the marks by time', () => {
|
||||
const transaction: Transaction = {
|
||||
transaction: {
|
||||
marks: {
|
||||
|
@ -33,4 +33,11 @@ describe('getAgentMarks', () => {
|
|||
} as any;
|
||||
expect(getAgentMarks(transaction)).toEqual([]);
|
||||
});
|
||||
|
||||
it('should return empty array if agent marks are missing', () => {
|
||||
const transaction: Transaction = {
|
||||
transaction: { marks: {} }
|
||||
} as any;
|
||||
expect(getAgentMarks(transaction)).toEqual([]);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -13,7 +13,7 @@ export interface AgentMark {
|
|||
}
|
||||
|
||||
export function getAgentMarks(transaction: Transaction): AgentMark[] {
|
||||
if (!transaction.transaction.marks) {
|
||||
if (!(transaction.transaction.marks && transaction.transaction.marks.agent)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ interface Context {
|
|||
}
|
||||
|
||||
interface Marks {
|
||||
agent: {
|
||||
agent?: {
|
||||
[name: string]: number;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue