Skip to content

Commit

Permalink
Merge pull request #13 from howbazaar/remove-resource-log
Browse files Browse the repository at this point in the history
#13

The resource-log never really adds any value when trying to look at what is going on the in the engine using the Report method. It is just noise, so removing it.
  • Loading branch information
jujubot committed Oct 18, 2019
2 parents 40da96d + 1651db7 commit 19a698a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 27 deletions.
5 changes: 2 additions & 3 deletions dependency/engine.go
Expand Up @@ -283,9 +283,8 @@ func (engine *Engine) manifoldsReport() map[string]interface{} {
manifolds := map[string]interface{}{}
for name, info := range engine.current {
report := map[string]interface{}{
KeyState: info.state(),
KeyInputs: engine.manifolds[name].Inputs,
KeyResourceLog: resourceLogReport(info.resourceLog),
KeyState: info.state(),
KeyInputs: engine.manifolds[name].Inputs,
}
if info.startCount > 0 {
report[KeyStartCount] = info.startCount
Expand Down
5 changes: 0 additions & 5 deletions dependency/reporter.go
Expand Up @@ -52,11 +52,6 @@ const (
// KeyInputs holds the names of the manifolds on which this one depends.
KeyInputs = "inputs"

// KeyResourceLog holds a slice representing the calls the current worker
// made to its getResource func; the type of the output param; and any
// error encountered.
KeyResourceLog = "resource-log"

// KeyName holds the name of some resource.
KeyName = "name"

Expand Down
27 changes: 8 additions & 19 deletions dependency/reporter_test.go
Expand Up @@ -98,11 +98,10 @@ func (s *ReportSuite) TestReportStopping(c *gc.C) {
"state": "stopping",
"manifolds": map[string]interface{}{
"task": map[string]interface{}{
"state": "stopping",
"start-count": 1,
"started": "2018-08-07 13:15:42",
"inputs": ([]string)(nil),
"resource-log": []map[string]interface{}{},
"state": "stopping",
"start-count": 1,
"started": "2018-08-07 13:15:42",
"inputs": ([]string)(nil),
"report": map[string]interface{}{
"key1": "hello there",
},
Expand All @@ -129,11 +128,10 @@ func (s *ReportSuite) TestReportInputs(c *gc.C) {
"state": "started",
"manifolds": map[string]interface{}{
"task": map[string]interface{}{
"state": "started",
"start-count": 1,
"started": "2018-08-07 13:15:42",
"inputs": ([]string)(nil),
"resource-log": []map[string]interface{}{},
"state": "started",
"start-count": 1,
"started": "2018-08-07 13:15:42",
"inputs": ([]string)(nil),
"report": map[string]interface{}{
"key1": "hello there",
},
Expand All @@ -143,10 +141,6 @@ func (s *ReportSuite) TestReportInputs(c *gc.C) {
"start-count": 1,
"started": "2018-08-07 13:15:42",
"inputs": []string{"task"},
"resource-log": []map[string]interface{}{{
"name": "task",
"type": "<nil>",
}},
"report": map[string]interface{}{
"key1": "hello there",
},
Expand All @@ -173,11 +167,6 @@ func (s *ReportSuite) TestReportError(c *gc.C) {
"state": "stopped",
"error": `"missing" not running: dependency not available`,
"inputs": []string{"missing"},
"resource-log": []map[string]interface{}{{
"name": "missing",
"type": "<nil>",
"error": `"missing" not running: dependency not available`,
}},
},
},
})
Expand Down

0 comments on commit 19a698a

Please sign in to comment.