66)
77
88type ResourceSinkCollector struct {
9- buildingEndpoint string
10- globalResourceEndpoint string
11- globalExplorationEndpoint string
9+ buildingEndpoint string
10+ globalResourceEndpoint string
11+ globalExplorationEndpoint string
1212}
1313
1414type ResourceSinkDetails struct {
@@ -17,17 +17,18 @@ type ResourceSinkDetails struct {
1717}
1818
1919type GlobalSinkDetails struct {
20- SinkType string `json:"Name"`
21- NumCoupon int `json:"NumCoupon"`
22- TotalPoints int `json:"TotalPoints"`
23- PointsToCoupon int `json:"PointsToCoupon"`
20+ SinkType string `json:"Name"`
21+ NumCoupon int `json:"NumCoupon"`
22+ TotalPoints int `json:"TotalPoints"`
23+ PointsToCoupon int `json:"PointsToCoupon"`
24+ Percent float64 `json:"Percent"`
2425}
2526
2627func NewResourceSinkCollector (buildingEndpoint , globalResourceEndpoint , globalExplorationEndpoint string ) * ResourceSinkCollector {
2728 return & ResourceSinkCollector {
28- buildingEndpoint : buildingEndpoint ,
29- globalResourceEndpoint : globalResourceEndpoint ,
30- globalExplorationEndpoint : globalExplorationEndpoint ,
29+ buildingEndpoint : buildingEndpoint ,
30+ globalResourceEndpoint : globalResourceEndpoint ,
31+ globalExplorationEndpoint : globalExplorationEndpoint ,
3132 }
3233}
3334
@@ -49,6 +50,7 @@ func (c *ResourceSinkCollector) Collect(frmAddress string, sessionName string) {
4950 for _ , d := range globalResourceDetails {
5051 ResourceSinkTotalPoints .WithLabelValues (d .SinkType , frmAddress , sessionName ).Set (float64 (d .TotalPoints ))
5152 ResourceSinkPointsToCoupon .WithLabelValues (d .SinkType , frmAddress , sessionName ).Set (float64 (d .PointsToCoupon ))
53+ ResourceSinkPercent .WithLabelValues (d .SinkType , frmAddress , sessionName ).Set (float64 (d .Percent ))
5254 ResourceSinkCollectedCoupons .WithLabelValues (frmAddress , sessionName ).Set (float64 (d .NumCoupon ))
5355 }
5456
@@ -62,6 +64,7 @@ func (c *ResourceSinkCollector) Collect(frmAddress string, sessionName string) {
6264 for _ , d := range globalExplorationDetails {
6365 ResourceSinkTotalPoints .WithLabelValues (d .SinkType , frmAddress , sessionName ).Set (float64 (d .TotalPoints ))
6466 ResourceSinkPointsToCoupon .WithLabelValues (d .SinkType , frmAddress , sessionName ).Set (float64 (d .PointsToCoupon ))
67+ ResourceSinkPercent .WithLabelValues (d .SinkType , frmAddress , sessionName ).Set (float64 (d .Percent ))
6568 }
6669
6770 powerInfo := map [float64 ]float64 {}
0 commit comments