Skip to content

Remove performance-types-exp #4500

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"@firebase/installations-compat",
"@firebase/messaging-exp",
"@firebase/performance-exp",
"@firebase/performance-types-exp",
"@firebase/remote-config-exp",
"@firebase/remote-config-compat",
"firebase-exp",
Expand Down
45 changes: 37 additions & 8 deletions common/api-review/performance-exp.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,47 @@
```ts

import { FirebaseApp } from '@firebase/app-exp';
import { FirebasePerformance } from '@firebase/performance-types-exp';
import { PerformanceSettings } from '@firebase/performance-types-exp';
import { PerformanceTrace } from '@firebase/performance-types-exp';

export { FirebasePerformance }
// @public (undocumented)
export interface FirebasePerformance {
dataCollectionEnabled: boolean;
instrumentationEnabled: boolean;
}

// @public
export function getPerformance(app: FirebaseApp, settings?: PerformanceSettings): FirebasePerformance;
export function getPerformance(app: FirebaseApp): FirebasePerformance;

export { PerformanceSettings }

export { PerformanceTrace }
// @public
export function initializePerformance(app: FirebaseApp, settings?: PerformanceSettings): FirebasePerformance;

// @public (undocumented)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably add documentation comments, I guess in a follow-up PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alikn Can we add missing documentation in a separate PR?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM.

export interface PerformanceSettings {
dataCollectionEnabled?: boolean;
instrumentationEnabled?: boolean;
}

// @public (undocumented)
export interface PerformanceTrace {
getAttribute(attr: string): string | undefined;
getAttributes(): {
[key: string]: string;
};
getMetric(metricName: string): number;
incrementMetric(metricName: string, num?: number): void;
putAttribute(attr: string, value: string): void;
putMetric(metricName: string, num: number): void;
record(startTime: number, duration: number, options?: {
metrics?: {
[key: string]: number;
};
attributes?: {
[key: string]: string;
};
}): void;
removeAttribute(attr: string): void;
start(): void;
stop(): void;
}

// @public
export function trace(performance: FirebasePerformance, name: string): PerformanceTrace;
Expand Down
45 changes: 0 additions & 45 deletions common/api-review/performance-types-exp.api.md

This file was deleted.

1 change: 0 additions & 1 deletion packages-exp/performance-exp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"@firebase/logger": "0.2.6",
"@firebase/installations-exp": "0.0.900",
"@firebase/util": "0.3.4",
"@firebase/performance-types-exp": "0.0.900",
"@firebase/component": "0.2.0",
"tslib": "^1.11.1"
},
Expand Down
5 changes: 1 addition & 4 deletions packages-exp/performance-exp/src/controllers/perf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ import { getInitializationPromise } from '../services/initialization_service';
import { Api } from '../services/api_service';
import { FirebaseApp } from '@firebase/app-exp';
import { _FirebaseInstallationsInternal } from '@firebase/installations-types-exp';
import {
PerformanceSettings,
FirebasePerformance
} from '@firebase/performance-types-exp';
import { PerformanceSettings, FirebasePerformance } from '../public_types';
import { validateIndexedDBOpenable } from '@firebase/util';
import { setupTransportService } from '../services/transport_service';
import { consoleLogger } from '../utils/console_logger';
Expand Down
2 changes: 1 addition & 1 deletion packages-exp/performance-exp/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
FirebasePerformance,
PerformanceSettings,
PerformanceTrace
} from '@firebase/performance-types-exp';
} from './public_types';
import { ERROR_FACTORY, ErrorCode } from './utils/errors';
import { setupApi } from './services/api_service';
import { PerformanceController } from './controllers/perf';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ export interface PerformanceTrace {
* start/stop. This is useful for use cases in which the trace cannot directly be used
* (e.g. if the duration was captured before the Performance SDK was loaded).
*
* @param startTime trace start time since epoch in millisec.
* @param duration The duraction of the trace in millisec.
* @param options An object which can optionally hold maps of custom metrics and
* @param startTime - trace start time since epoch in millisec.
* @param duration - The duraction of the trace in millisec.
* @param options - An object which can optionally hold maps of custom metrics and
* custom attributes.
*/
record(
Expand All @@ -76,8 +76,8 @@ export interface PerformanceTrace {
* exist, it creates one with that name and the value equal to the given number. The value will be floored down to an
* integer.
*
* @param metricName The name of the custom metric.
* @param num The number to be added to the value of the custom metric. If not provided, it
* @param metricName - The name of the custom metric.
* @param num - The number to be added to the value of the custom metric. If not provided, it
* uses a default value of one.
*/
incrementMetric(metricName: string, num?: number): void;
Expand All @@ -86,34 +86,34 @@ export interface PerformanceTrace {
* a metric with that name already exists on the trace instance or not. The value will be floored down to an
* integer.
*
* @param metricName Name of the custom metric.
* @param num Value to of the custom metric.
* @param metricName - Name of the custom metric.
* @param num - Value to of the custom metric.
*/
putMetric(metricName: string, num: number): void;
/**
* Returns the value of the custom metric by that name. If a custom metric with that name does
* not exist will return zero.
*
* @param metricName Name of the custom metric.
* @param metricName - Name of the custom metric.
*/
getMetric(metricName: string): number;
/**
* Set a custom attribute of a trace to a certain value.
*
* @param attr Name of the custom attribute.
* @param value Value of the custom attribute.
* @param attr - Name of the custom attribute.
* @param value - Value of the custom attribute.
*/
putAttribute(attr: string, value: string): void;
/**
* Retrieves the value which a custom attribute is set to.
*
* @param attr Name of the custom attribute.
* @param attr - Name of the custom attribute.
*/
getAttribute(attr: string): string | undefined;
/**
* Removes the specified custom attribute from a trace instance.
*
* @param attr Name of the custom attribute.
* @param attr - Name of the custom attribute.
*/
removeAttribute(attr: string): void;
/**
Expand Down
2 changes: 1 addition & 1 deletion packages-exp/performance-exp/src/resources/trace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import {
isValidMetricName,
convertMetricValueToInteger
} from '../utils/metric_utils';
import { PerformanceTrace } from '@firebase/performance-types-exp';
import { PerformanceTrace } from '../public_types';
import { PerformanceController } from '../controllers/perf';

const enum TraceState {
Expand Down
5 changes: 0 additions & 5 deletions packages-exp/performance-types-exp/api-extractor.json

This file was deleted.

30 changes: 0 additions & 30 deletions packages-exp/performance-types-exp/package.json

This file was deleted.

9 changes: 0 additions & 9 deletions packages-exp/performance-types-exp/tsconfig.json

This file was deleted.