()
| 174 | } |
| 175 | |
| 176 | func ExampleService_Stats() { |
| 177 | nc, err := nats.Connect("127.0.0.1:4222") |
| 178 | if err != nil { |
| 179 | log.Fatal(err) |
| 180 | } |
| 181 | defer nc.Close() |
| 182 | |
| 183 | config := micro.Config{ |
| 184 | Name: "EchoService", |
| 185 | Version: "0.1.0", |
| 186 | Endpoint: µ.EndpointConfig{ |
| 187 | Subject: "echo", |
| 188 | Handler: micro.HandlerFunc(func(r micro.Request) {}), |
| 189 | }, |
| 190 | } |
| 191 | |
| 192 | srv, _ := micro.AddService(nc, config) |
| 193 | // stats of a service instance |
| 194 | stats := srv.Stats() |
| 195 | |
| 196 | fmt.Println(stats.Endpoints[0].AverageProcessingTime) |
| 197 | fmt.Println(stats.Endpoints[0].ProcessingTime) |
| 198 | |
| 199 | } |
| 200 | |
| 201 | func ExampleService_Stop() { |
| 202 | nc, err := nats.Connect("127.0.0.1:4222") |
nothing calls this directly
no test coverage detected