(context.Context, *ppb.GetStreamStatsRequest)
| 134 | } |
| 135 | |
| 136 | func (s *profilingServer) GetStreamStats(context.Context, *ppb.GetStreamStatsRequest) (*ppb.GetStreamStatsResponse, error) { |
| 137 | // Since the drain operation is destructive, only one client request should |
| 138 | // be served at a time. |
| 139 | logger.Infof("profilingServer: GetStreamStats: processing request") |
| 140 | s.drainMutex.Lock() |
| 141 | results := profiling.StreamStats.Drain() |
| 142 | s.drainMutex.Unlock() |
| 143 | |
| 144 | logger.Infof("profilingServer: GetStreamStats: returning %v records", len(results)) |
| 145 | streamStats := make([]*ppb.Stat, 0) |
| 146 | for _, stat := range results { |
| 147 | streamStats = append(streamStats, statToProtoStat(stat.(*profiling.Stat))) |
| 148 | } |
| 149 | return &ppb.GetStreamStatsResponse{StreamStats: streamStats}, nil |
| 150 | } |
nothing calls this directly
no test coverage detected