Skip to content
Snippets Groups Projects
Commit fa8a40a2 authored by Gomez Goiri, Aitor's avatar Gomez Goiri, Aitor
Browse files

Adding new operation to reset stats

Useful during development
parent f04b619d
No related branches found
No related tags found
No related merge requests found
...@@ -251,6 +251,16 @@ func ContextOperations(m shared.AbstractChaincodeOperationManager) error { ...@@ -251,6 +251,16 @@ func ContextOperations(m shared.AbstractChaincodeOperationManager) error {
nil, nil,
assetController.OnlySameOrg(bidDecisionController.AcceptBid), assetController.OnlySameOrg(bidDecisionController.AcceptBid),
). ).
// For debugging stats
AddOperation(
"hypercog-stats-reset",
shared.WRITE_OP,
[]shared.MiddlewareInterface{
m2.RejectIfNotPublicAdmin,
},
nil,
stats.ResetStats,
).
Build(m) Build(m)
return nil return nil
......
...@@ -49,3 +49,8 @@ func GetStatsOperation(stub shared.LedgerBuildrStubInterface, request shared.Led ...@@ -49,3 +49,8 @@ func GetStatsOperation(stub shared.LedgerBuildrStubInterface, request shared.Led
return api.NewAPIGenericResponsePtr(fnName, nil, ret).SendResponse() return api.NewAPIGenericResponsePtr(fnName, nil, ret).SendResponse()
} }
func ResetStats(stub shared.LedgerBuildrStubInterface, request shared.LedgerBuildrAsset) protos.Response {
err := resetStats(stub)
return api.NewAPIGenericResponsePtr("ResetStats", err, nil).SendResponse()
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment