"tests/test_modules/test_fid_inception.py" did not exist on "b7536f78b8574f78c30bc1603be632dabfff5541"
README.md 1.99 KB
Newer Older
Ryan Olson's avatar
Ryan Olson committed
1
2
3
4
5
# Service Metrics

This example extends the hello_world example by calling the `scrape_service` method
with the service name for the request response the client just issued a request.

6
7
8
9
```bash
TRD_LOG=debug cargo run --bin server
```

Ryan Olson's avatar
Ryan Olson committed
10
11
12
The client can now observe some basic statistics about each instance of the service
begin hosted.

13
14
15
```bash
TRD_LOG=info cargo run --bin client
```
Ryan Olson's avatar
Ryan Olson committed
16
17
18
19
20
21
22
23
24
25
26
27
28
29

## Example Output
```
Annotated { data: Some("h"), id: None, event: None, comment: None }
Annotated { data: Some("e"), id: None, event: None, comment: None }
Annotated { data: Some("l"), id: None, event: None, comment: None }
Annotated { data: Some("l"), id: None, event: None, comment: None }
Annotated { data: Some("o"), id: None, event: None, comment: None }
Annotated { data: Some(" "), id: None, event: None, comment: None }
Annotated { data: Some("w"), id: None, event: None, comment: None }
Annotated { data: Some("o"), id: None, event: None, comment: None }
Annotated { data: Some("r"), id: None, event: None, comment: None }
Annotated { data: Some("l"), id: None, event: None, comment: None }
Annotated { data: Some("d"), id: None, event: None, comment: None }
30
ServiceSet { services: [ServiceInfo { name: "triton_init_backend_720278f8", id: "eOHMc4ndRw8s5flv4WOZx7", version: "0.0.1", started: "2025-02-26T18:54:04.917294605Z", endpoints: [EndpointInfo { name: "triton_init_backend_720278f8-generate-694d951a80e06abf", subject: "triton_init_backend_720278f8.generate-694d951a80e06abf", data: Some(Metrics(Object {"average_processing_time": Number(53662), "data": Object {"val": Number(10)}, "last_error": String(""), "num_errors": Number(0), "num_requests": Number(2), "processing_time": Number(107325), "queue_group": String("q")})) }] }] }
Ryan Olson's avatar
Ryan Olson committed
31
```
32
33
34
35
36
37
38
39

Note the following stats in the output demonstrate the custom
`stats_handler` attached to the service in `server.rs` is being invoked:
```
data: Some(Metrics(Object {..., "data": Object {"val": Number(10)}, ...)
```

If you start two copies of the server, you will see two entries being emitted.