CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-angular--fire

Angular + Firebase integration library providing Angular-native services, dependency injection, Zone.js wrappers, Observable-based APIs, and comprehensive Firebase service support.

Pending
Overview
Eval results
Files

performance.mddocs/

Performance Monitoring

Firebase Performance Monitoring helps monitor your app's performance with automatic and custom performance traces.

Capabilities

Standalone Provider

export function providePerformance(fn: () => Performance): EnvironmentProviders;
export function getPerformance(app?: FirebaseApp): Performance;

Angular Services

export class Performance extends Performance {}
export class PerformanceInstances extends Array<Performance> {}
export const performanceInstance$: Observable<Performance>;

Performance Functions

/**
 * Create custom performance trace
 * @param performance - Performance instance
 * @param name - Trace name
 * @returns Performance trace
 */
export function trace(performance: Performance, name: string): Trace;

/**
 * Check if Performance Monitoring is supported
 * @returns Promise resolving to support status
 */
export function isSupported(): Promise<boolean>;

interface Trace {
  start(): void;
  stop(): void;
  putAttribute(name: string, value: string): void;
  getAttribute(name: string): string | undefined;
  removeAttribute(name: string): void;
  getAttributes(): { [key: string]: string };
  putMetric(name: string, value: number): void;
  getMetric(name: string): number;
  incrementMetric(name: string, value?: number): void;
}

Usage Examples

import { Component, inject } from '@angular/core';
import { Performance, trace } from '@angular/fire/performance';

@Component({
  selector: 'app-performance',
  template: `...`,
})
export class PerformanceComponent {
  private performance = inject(Performance);

  async performExpensiveOperation() {
    const customTrace = trace(this.performance, 'expensive_operation');
    customTrace.start();
    
    try {
      // Perform the operation
      const result = await this.doExpensiveWork();
      
      customTrace.putAttribute('success', 'true');
      customTrace.putMetric('items_processed', result.length);
      
      return result;
    } catch (error) {
      customTrace.putAttribute('success', 'false');
      customTrace.putAttribute('error', error.message);
      throw error;
    } finally {
      customTrace.stop();
    }
  }
  
  private async doExpensiveWork() {
    // Simulate expensive operation
    return new Promise(resolve => {
      setTimeout(() => resolve([1, 2, 3, 4, 5]), 2000);
    });
  }
}

Install with Tessl CLI

npx tessl i tessl/npm-angular--fire

docs

ai.md

analytics.md

app-check.md

auth-guard.md

authentication.md

data-connect.md

database.md

firebase-app.md

firestore.md

functions.md

index.md

messaging.md

performance.md

remote-config.md

storage.md

vertexai.md

tile.json