Skip to content

Commit 1a256c8

Browse files
committed
Rename collector and timing files; update README for TimingCollector and Timing usage
1 parent 64224c1 commit 1a256c8

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ Install the package:
1010
bun add @edgefirst-dev/server-timing
1111
```
1212

13-
Instantiate the collector:
13+
Instantiate the timing collector:
1414

1515
```ts
16-
import { Collector } from "@edgefirst-dev/server-timing";
16+
import { TimingCollector } from "@edgefirst-dev/server-timing";
1717

1818
// You can instantiate this in the getLoadContext of Remix or React Router
19-
let collector = new Collector();
19+
let collector = new TimingCollector();
2020
```
2121

2222
Take measurements:
@@ -42,9 +42,9 @@ collector.toHeaders(headers);
4242
You can also manually collect timings:
4343

4444
```ts
45-
import { ServerTiming } from "@edgefirst-dev/server-timing";
45+
import { Timing } from "@edgefirst-dev/server-timing";
4646

47-
let timing = new ServerTiming("name", "description");
47+
let timing = new Timing("name", "description");
4848

4949
timing.measure(async () => {
5050
// do something
@@ -53,7 +53,7 @@ timing.measure(async () => {
5353
collector.add(timing);
5454
```
5555

56-
Each `ServerTiming` can be used once. If you want to take different measurements, create a new `ServerTiming` instance.
56+
Each `Timing` can be used once. If you want to take different measurements, create a new `Timing` instance.
5757

5858
> [!TIP]
59-
> Use the `Collector#measure` method to automatically create a `ServerTiming` instance and add it to the collector.
59+
> Use the `Collector#measure` method to automatically create a `Timing` instance and add it to the collector.

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import { TimingCollector } from "./lib/collector.js";
2-
import { Timing } from "./lib/server-timing.js";
1+
import { TimingCollector } from "./lib/timing-collector.js";
2+
import { Timing } from "./lib/timing.js";
33
export { TimingCollector, Timing };
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Timing } from "./server-timing.js";
1+
import { Timing } from "./timing.js";
22

33
export class TimingCollector {
44
collection = new Set<Timing>();

0 commit comments

Comments
 (0)