# @atlassian/metrics-interface

## 4.0.0

### Major Changes

- 6215e00df: Upgrade Node version to 20

## 3.0.2

### Patch Changes

- 172390575: added list of onboarded packages and updated package descriptions

## 3.0.1

### Patch Changes

- 39e14c1c: onboarding metrics as platform packages

## 3.0.0

### Major Changes

- e93d72e: Add histogram() method to Metrics interface.

  ### Migration

  This is a relatively safe change, but it might break your builds if you use `Metrics` type as now it should have a
  "histogram" method.

  ### Example

  Here's how you can use histograms in your code:

  ```typescript
  import { Metrics } from '@atlassian/metrics-interface';

  const metrics: Metrics = {
    /* ... */
  };

  const buckets = [10, 50, 100];
  const tags = {
    /* ... */
  };
  const timer = metrics.histogram('metricName', buckets, extraTags).measure();

  // ...some I/O operation

  const extraTags = {
    /* ... */
  };
  timer.stop(extraTags);
  ```

## 2.3.0

### Minor Changes

- bdcf6df: Add support for set metric type: https://github.com/statsd/statsd/blob/master/docs/metric_types.md#sets.
  Counts the number of unique values between flushes.

  ```javascript
  metrics.set('aSet', { foo: 'bar' }).add('foo');
  metrics.set('aSet', { foo: 'bar' }).add('bar');
  metrics.set('aSet', { foo: 'bar' }).add('foo');

  // results in metric aSet reporting a count of 2 (2 unique values 'foo' and 'bar' added to set in the flush interval)
  ```

## 2.2.0

### Minor Changes

- 1505248: Use the "node:" style import declaration for NodeJS builtins

## 2.1.1

### Patch Changes

- d46b350: Bind now one time instead of every time measure is called.

## 2.1.0

### Minor Changes

- 1b15f45: Fix for Node 20

## 2.0.1

### Patch Changes

- 174f3f5: incredible-monorepo renamed to node-monorepo

## 2.0.0

### Major Changes

- b6125f0: Upgrade NodeJS typings to v16. Package now targets NodeJS runtime 16 and above, all previous NodeJS versions
  are now unsupported.

### Minor Changes

- b6125f0: Add support for passing in a function to get the current time, defaults to `performance.now`.

## 1.3.3

### Patch Changes

- c0069ef: Package is now compiled with Typescript 4.4

  Useful links:

  - https://github.com/Microsoft/TypeScript-wiki/blob/main/Breaking-Changes.md#more-compliant-indirect-calls-for-imported-functions
  - http://perfectionkills.com/global-eval-what-are-the-options/

## 1.3.2

### Patch Changes

- fae10a6: Fixed an issue with compiled typings files after upgrading to TypeScript 4.3. The imports in the typings.d.ts
  files were compiled with paths relative to the monorepo root, rather than absolute package paths. This problem has now
  been fixed.

## 1.3.1

### Patch Changes

- fae1cc7: Minor type changes and tweaks so the package now builds with TypeScript ~4.3

## 1.3.0

### Minor Changes

- 9913f59: feat: Added configurable timing precision, repalced hrtime with performance from perf_hooks

## 1.2.4

### Patch Changes

- fae14d5: An upgrade to prettier caused some changes to linting

## 1.2.3

### Patch Changes

- fae196c: Added a feature to the monorepo so packages with non js entrypoints can be used

## 1.2.2

### Patch Changes

- fae1709: Fixed an issue during package building, so bumping all packages to ensure distribution assets are valid

## 1.2.1

### Patch Changes

- 97644a1: Set Typescript Compiler target to ES2018

## 1.2.0

### Minor Changes

- 3e7f6c1: feat: metrics.timing() supports passing tags in stop() function, stop() returns value

## 1.1.2

### Patch Changes

- fae1a543: In files where @typescript-eslint/no-namespaces is already ignored, also ignore import/export.

## 1.1.1

### Patch Changes

- fae18d7: linting updates to the monorepo

## 1.1.0

### Minor Changes

- 1f4aaad: feat: metrics.counter has new 'incrBy' and 'decrBy' interface

## 1.0.15

### Patch Changes

- 85bb2aa: monorepo changes: rename packageJson.publishConfig to packageJson.config.publishOverrides

## 1.0.14

### Patch Changes

- 645304b: fix: ensure all monorepo packages do not use ranges in their dependencies (for changeset's automatic bumps)

## 1.0.13

### Patch Changes

- 6af309e: chore: update homepage field in package.json

## 1.0.12

### Patch Changes

- 37e36f9: fix: the main, types and typings fields in package.json were incorrect on publish

## 1.0.11

### Patch Changes

- b9aad92: fix: the previous patch version did not contain dist files

## 1.0.10

### Patch Changes

- c255e4f: Dev improvements: Updated how the package is tested and published

## 1.0.9

### Patch Changes

- 30c71b0: Add eslint import rules.
