MCPcopy Create free account
hub / github.com/NativeScript/firebase / HttpMetric

Class HttpMetric

packages/firebase-performance/index.ios.ts:39–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37 }
38}
39export class HttpMetric implements IHttpMetric {
40 _native: FIRHTTPMetric;
41 static fromUrlMethod(url: string, method: HttpMethod) {
42 if (url && method) {
43 const result = new HttpMetric();
44 result._native = FIRHTTPMetric.alloc().initWithURLHTTPMethod(NSURL.URLWithString(url), toHttpMethod(method));
45 return result;
46 }
47 return null;
48 }
49 get native() {
50 return this._native;
51 }
52 get ios() {
53 return this.native;
54 }
55
56 getAttribute(attribute: string): string {
57 return this.native.valueForAttribute(attribute);
58 }
59 getAttributes(): { [key: string]: string } {
60 return deserialize(this.native.attributes);
61 }
62 putAttribute(attribute: string, value: string): void {
63 this.native.setValueForAttribute(value, attribute);
64 }
65 removeAttribute(attribute: string): void {
66 this.native.removeAttribute(attribute);
67 }
68 setHttpResponseCode(code: number): void {
69 this.native.responseCode = code;
70 }
71 setRequestPayloadSize(bytes: number): void {
72 this.native.requestPayloadSize = bytes;
73 }
74 setResponseContentType(contentType: string): void {
75 this.native.responseContentType = contentType;
76 }
77 setResponsePayloadSize(bytes: number): void {
78 this.native.responsePayloadSize = bytes;
79 }
80 start() {
81 this.native.start();
82 }
83 stop() {
84 this.native.stop();
85 }
86}
87
88export class Trace implements ITrace {
89 _native: FIRTrace;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected