Options
All
  • Public
  • Public/Protected
  • All
Menu

@zowe/perf-timing - v1.0.6

Index

Type aliases

CollectionMap

CollectionMap<T>: Map<string, T>

A type that generically defines all collection observer maps that are defined to the Performance API.

Type parameters

FunctionMetric

FunctionMetric: IMetric<IPerformanceEntry>

Data collected for all functions that were monitored with the PerformanceApi.watch function.

MeasurementMetric

MeasurementMetric: IMetric<IMeasurementEntry>

Data collected for all measurements taken through the PerformanceApi.measure function.

ValidDefaults

ValidDefaults: string | number

Represents the valid types that may be registered in the environment.

ValidDefaultsStrings

ValidDefaultsStrings: "string" | "number"

A string mapping to the valid defaults types.

ValidationFunction

ValidationFunction: function

A function that will be used to validate the environmental variable. Only intended to be used by the EnvironmentManager class.

param

The environment key to check.

throws

TypeMismatchError when validation fails.

Type declaration

    • (key: string): void
    • Parameters

      • key: string

      Returns void

_GlobalType

_GlobalType: Global

Exported so tests can make use of the global type defined here.

Variables

Const ENV_IO_MAX_HISTORY

ENV_IO_MAX_HISTORY: string = `${ENV_PREFIX}_IO_MAX_HISTORY`

Environment key prefix for the max history value. Max history refers to the max number of log entries to keep when performance is enabled.

Const ENV_IO_SAVE_DIR

ENV_IO_SAVE_DIR: string = `${ENV_PREFIX}_IO_SAVE_DIR`

Environment key prefix for where the logs are saved.

Const ENV_PREFIX

ENV_PREFIX: "PERF_TIMING" = "PERF_TIMING"

This is the environmental prefix that will be added to any configuration settings for performance.

Const Environment

Environment: EnvironmentManager = new EnvironmentManager()

Exported singleton of the EnvironmentManager.

Const GLOBAL_SYMBOL

GLOBAL_SYMBOL: unique symbol = Symbol.for("org.zowe.perf-timing")

Symbol used to ensure uniqueness across all possible instances of this package.

Const PerfTiming

PerfTiming: PerformanceApiManager = new PerformanceApiManager()

An instance of a PerformanceApiManager. Public functionality is exported under this name.

global

global: Global

Definition of the global typings needed for this class.

Functions

getMetricFileName

  • getMetricFileName(directory: string, index: number): string
  • Get a constant file path for a given history item index.

    Parameters

    • directory: string

      The directory of the file

    • index: number

      The index of the file in the history

    Returns string

    The formatted file name that will be saved

saveMetrics

  • Save metrics into the next log file.

    Upon execution this function will first roll any logs based on the value present within environmental ENV_IO_MAX_HISTORY variable. The directory that is checked will be determined from the ENV_IO_SAVE_DIR value.

    todo

    This function needs to be enhanced so that an environment variable can influence the file name.

    Parameters

    Returns void

Generated using TypeDoc