kiva / protocol-common

Shared code across the various protocol microservices
Apache License 2.0
10 stars 3 forks source link

Make common stats object #75

Open matt-raffel-kiva opened 2 years ago

matt-raffel-kiva commented 2 years ago

Once we stablize the content of the statistics report consumed in our services, we should make this type common and shared.

At this time, the structure is as below but we should be confident this is the final structure before sharing across all services.

export class ServiceReportDto {
    @IsString() serviceName: string;
    @IsString() startedAt: string;
    @IsString() currentTime: string;
    @IsArray() versions: string[];
}

Consider changing versions to resources since this field is intended to be more freeform reporting.

Likewise we might want to add some common functionality around gathering shared statistics of a service. See https://github.com/kiva/protocol-reporting/blob/dc2b99d60f3411cb94e2e68b58da6934956106bd/src/app/app.service.ts#L33 as an example.