Skip to content

Commit

Permalink
export EntityArrayIterable directly
Browse files Browse the repository at this point in the history
  • Loading branch information
Mpdreamz committed Apr 14, 2022
1 parent 37b4f84 commit 9df8a7e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/elastic-apm-synthtrace/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ export { createLogger, LogLevel } from './lib/utils/create_logger';
export type { Fields } from './lib/entity';
export type { ApmFields } from './lib/apm/apm_fields';
export type { ApmException, ApmSynthtraceEsClient } from './lib/apm';
export type { EntityIterable, EntityArrayIterable } from './lib/entity_iterable';
export type { EntityIterable } from './lib/entity_iterable';
export { EntityArrayIterable } from './lib/entity_iterable';
4 changes: 3 additions & 1 deletion packages/elastic-apm-synthtrace/src/lib/entity_iterable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ export interface EntityIterable<TFields extends Fields = ApmFields>
merge(...iterables: Array<EntityIterable<TFields>>): EntityStreams<TFields>;
}

export class EntityArrayIterable<TFields extends Fields> implements EntityIterable<TFields> {
export class EntityArrayIterable<TFields extends Fields = ApmFields>
implements EntityIterable<TFields>
{
constructor(private fields: TFields[]) {
const timestamps = fields.filter((f) => f['@timestamp']).map((f) => f['@timestamp']!);
this._order = timestamps.length > 1 ? (timestamps[0] > timestamps[1] ? 'desc' : 'asc') : 'asc';
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/apm/ftr_e2e/cypress/plugins/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import {
apm,
createLogger,
LogLevel,
EntityArrayIterable,
LogLevel,
} from '@elastic/apm-synthtrace';
import { createEsClientForTesting } from '@kbn/test';

Expand Down

0 comments on commit 9df8a7e

Please sign in to comment.