From a00d135a6d1f8c83f9de32c26b22b46c5561b582 Mon Sep 17 00:00:00 2001 From: Ben Bartlett Date: Thu, 22 Mar 2018 15:39:19 -0700 Subject: [PATCH] settings consolidation, signature bugfix, header added to first compiled file --- src/CHANGELOG.md => CHANGELOG.md | 17 +- assets/Grafana Dashboards/Overmind.json | 402 +++++++-------------- assets/Grafana Dashboards/installation.txt | 5 + assets/basePlanner/spiral_bunker.txt | 1 + 4 files changed, 158 insertions(+), 267 deletions(-) rename src/CHANGELOG.md => CHANGELOG.md (77%) create mode 100644 assets/Grafana Dashboards/installation.txt create mode 100644 assets/basePlanner/spiral_bunker.txt diff --git a/src/CHANGELOG.md b/CHANGELOG.md similarity index 77% rename from src/CHANGELOG.md rename to CHANGELOG.md index ec3ddfad3..f3af4dadb 100644 --- a/src/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,20 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +## Overmind [0.2.1] - 2018.3.22 +### Added +- Memory stat collection and `User` variable (#3 - thanks CoolFeather2!) +- Brief setup instructions for dashboard +- Assets for possible future bunker layout + +### Changed +- Added adaptive thresholds to logistics system requests, should slightly improve CPU usage +- Switched dependency to personal fork of `typed-screeps` + +### Fixed +- Bugfixes with rollup and screeps-profiler +- Moved changelog to root + ## Overmind [0.2.0]: "Logistics Logic" - 2018.3.15 ### Added - Logistic groups, tranport overlords have now been enabled after being present in the previous few commits @@ -32,6 +46,7 @@ This release was initially deployed on 2018.3.2 but was re-versioned on 2018.3.1 ### Added - Initial pre-release of Overmind after 190 commits and about 80,000 additions. -[Unreleased]: https://github.com/bencbartlett/Overmind/compare/v0.2.0...HEAD +[Unreleased]: https://github.com/bencbartlett/Overmind/compare/v0.2.1...HEAD +[0.2.1]: https://github.com/bencbartlett/Overmind/compare/v0.2.0...v0.2.1 [0.2.0]: https://github.com/bencbartlett/Overmind/compare/v0.1.0...v0.2.0 [0.1.0]: https://github.com/bencbartlett/Overmind/releases/tag/v0.1.0 diff --git a/assets/Grafana Dashboards/Overmind.json b/assets/Grafana Dashboards/Overmind.json index 111ad2431..e673c1a49 100644 --- a/assets/Grafana Dashboards/Overmind.json +++ b/assets/Grafana Dashboards/Overmind.json @@ -1,49 +1,8 @@ { - "__inputs": [ - { - "name": "DS_SCREEPSPLUS-GRAPHITE", - "label": "ScreepsPlus-Graphite", - "description": "", - "type": "datasource", - "pluginId": "graphite", - "pluginName": "Graphite" - } - ], - "__requires": [ - { - "type": "grafana", - "id": "grafana", - "name": "Grafana", - "version": "5.0.1" - }, - { - "type": "panel", - "id": "grafana-piechart-panel", - "name": "Pie Chart", - "version": "1.2.0" - }, - { - "type": "panel", - "id": "graph", - "name": "Graph", - "version": "5.0.0" - }, - { - "type": "datasource", - "id": "graphite", - "name": "Graphite", - "version": "5.0.0" - }, - { - "type": "panel", - "id": "singlestat", - "name": "Singlestat", - "version": "5.0.0" - } - ], "annotations": { "list": [ { + "$$hashKey": "object:82", "builtIn": 1, "datasource": "-- Grafana --", "enable": true, @@ -57,8 +16,8 @@ "editable": true, "gnetId": null, "graphTooltip": 1, - "id": null, - "iteration": 1521284587194, + "id": 2135, + "iteration": 1521757712438, "links": [], "panels": [ { @@ -84,7 +43,7 @@ "rgba(237, 129, 40, 0.89)", "rgba(245, 54, 54, 0.9)" ], - "datasource": "${DS_SCREEPSPLUS-GRAPHITE}", + "datasource": "ScreepsPlus-Graphite", "editable": true, "error": false, "format": "percent", @@ -96,8 +55,8 @@ "thresholdMarkers": true }, "gridPos": { - "h": 8, - "w": 4, + "h": 7, + "w": 6, "x": 0, "y": 1 }, @@ -164,100 +123,20 @@ ], "valueName": "current" }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "datasource": "${DS_SCREEPSPLUS-GRAPHITE}", - "editable": true, - "error": false, - "format": "none", - "gauge": { - "maxValue": 10000, - "minValue": 0, - "show": true, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 8, - "w": 4, - "x": 4, - "y": 1 - }, - "id": 25, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": true - }, - "tableColumn": "", - "targets": [ - { - "refId": "A", - "target": "screeps.$User.cpu.bucket" - } - ], - "thresholds": "1500,3000", - "title": "Bucket", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" - }, { "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, - "datasource": "${DS_SCREEPSPLUS-GRAPHITE}", + "datasource": "ScreepsPlus-Graphite", "editable": true, "error": false, "fill": 0, "grid": {}, "gridPos": { - "h": 8, - "w": 16, - "x": 8, + "h": 12, + "w": 18, + "x": 6, "y": 1 }, "height": "", @@ -291,6 +170,11 @@ "alias": "CPU", "fill": 2, "linewidth": 1 + }, + { + "alias": "Limit", + "color": "#bf1b00", + "linewidth": 1 } ], "spaceLength": 10, @@ -304,6 +188,7 @@ "target": "alias(screeps.$User.cpu.getUsed, 'CPU')" }, { + "hide": true, "refCount": 0, "refId": "A", "target": "alias(screeps.$User.cpu.bucket, 'Bucket')" @@ -358,46 +243,33 @@ } ] }, - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 9 - }, - "id": 87, - "panels": [], - "title": "Memory", - "type": "row" - }, { "cacheTimeout": null, "colorBackground": false, "colorValue": false, "colors": [ - "rgba(50, 172, 45, 0.97)", + "rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", - "rgba(245, 54, 54, 0.9)" + "rgba(50, 172, 45, 0.97)" ], - "datasource": "${DS_SCREEPSPLUS-GRAPHITE}", + "datasource": "ScreepsPlus-Graphite", "editable": true, "error": false, - "format": "decbytes", + "format": "none", "gauge": { - "maxValue": 2048000, + "maxValue": 10000, "minValue": 0, "show": true, "thresholdLabels": false, "thresholdMarkers": true }, "gridPos": { - "h": 8, - "w": 6, + "h": 5, + "w": 3, "x": 0, - "y": 10 + "y": 8 }, - "id": 84, + "id": 25, "interval": null, "links": [], "mappingType": 1, @@ -434,16 +306,14 @@ "tableColumn": "", "targets": [ { - "hide": false, - "refCount": 0, "refId": "A", - "target": "movingAverage(screeps.$User.memory.used, 5)" + "target": "screeps.$User.cpu.bucket" } ], - "thresholds": "1433600,1740800", - "title": "Memory Usage", + "thresholds": "1500,3000", + "title": "Bucket", "type": "singlestat", - "valueFontSize": "100%", + "valueFontSize": "80%", "valueMaps": [ { "op": "=", @@ -451,107 +321,89 @@ "value": "null" } ], - "valueName": "current" + "valueName": "avg" }, { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${DS_SCREEPSPLUS-GRAPHITE}", + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "rgba(50, 172, 45, 0.97)", + "rgba(237, 129, 40, 0.89)", + "rgba(245, 54, 54, 0.9)" + ], + "datasource": "ScreepsPlus-Graphite", "editable": true, "error": false, - "fill": 0, - "grid": {}, - "gridPos": { - "h": 8, - "w": 18, - "x": 6, - "y": 10 + "format": "decbytes", + "gauge": { + "maxValue": 2048000, + "minValue": 0, + "show": true, + "thresholdLabels": false, + "thresholdMarkers": true }, - "height": "", - "id": 85, - "legend": { - "alignAsTable": true, - "avg": false, - "current": false, - "max": false, - "min": false, - "rightSide": true, - "show": false, - "sideWidth": null, - "total": false, - "values": false + "gridPos": { + "h": 5, + "w": 3, + "x": 3, + "y": 8 }, - "lines": true, - "linewidth": 2, + "id": 84, + "interval": null, "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, "nullPointMode": "connected", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ { - "alias": "Memory", - "fill": 2, - "linewidth": 1 + "from": "null", + "text": "N/A", + "to": "null" } ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", "targets": [ - { - "refCount": 0, - "refId": "A", - "target": "alias(screeps.$User.memory.used, 'Memory')", - "textEditor": false - }, { "hide": false, "refCount": 0, - "refId": "B", - "target": "alias(offset(scale(screeps.$User.memory.used, 0), 2048000), 'Limit')", - "textEditor": false + "refId": "A", + "target": "movingAverage(screeps.$User.memory.used, 5)" } ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "Memory", - "tooltip": { - "msResolution": true, - "shared": true, - "sort": 0, - "value_type": "cumulative" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "decbytes", - "label": null, - "logBase": 1, - "max": null, - "min": 0, - "show": true - }, + "thresholds": "1433600,1740800", + "title": "Memory Usage", + "type": "singlestat", + "valueFontSize": "100%", + "valueMaps": [ { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": 0, - "show": true + "op": "=", + "text": "N/A", + "value": "null" } - ] + ], + "valueName": "current" }, { "collapsed": false, @@ -559,7 +411,7 @@ "h": 1, "w": 24, "x": 0, - "y": 18 + "y": 13 }, "id": 82, "panels": [], @@ -576,7 +428,7 @@ "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)" ], - "datasource": "${DS_SCREEPSPLUS-GRAPHITE}", + "datasource": "ScreepsPlus-Graphite", "decimals": 1, "editable": true, "error": false, @@ -592,7 +444,7 @@ "h": 8, "w": 4, "x": 0, - "y": 19 + "y": 14 }, "height": "", "id": 59, @@ -671,7 +523,7 @@ "rgba(237, 129, 40, 0.89)", "rgba(245, 54, 54, 0.9)" ], - "datasource": "${DS_SCREEPSPLUS-GRAPHITE}", + "datasource": "ScreepsPlus-Graphite", "decimals": 1, "editable": true, "error": false, @@ -687,7 +539,7 @@ "h": 8, "w": 4, "x": 4, - "y": 19 + "y": 14 }, "id": 60, "interval": null, @@ -773,7 +625,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "${DS_SCREEPSPLUS-GRAPHITE}", + "datasource": "ScreepsPlus-Graphite", "editable": true, "error": false, "fill": 1, @@ -782,7 +634,7 @@ "h": 8, "w": 16, "x": 8, - "y": 19 + "y": 14 }, "id": 50, "legend": { @@ -823,13 +675,15 @@ "steppedLine": false, "targets": [ { + "$$hashKey": "object:164", "hide": false, "refCount": 0, "refId": "A", - "target": "alias(scale(movingAverage(perSecond(keepLastValue(screeps.$User.gcl.progress)), 10), 86400), 'GCL / 24hr')", + "target": "alias(scale(movingAverage(perSecond(keepLastValue(screeps.$User.gcl.progress, 100)), 10), 86400), 'GCL / 24hr')", "textEditor": false }, { + "$$hashKey": "object:165", "hide": true, "refCount": 0, "refId": "B", @@ -837,9 +691,10 @@ "textEditor": false }, { + "$$hashKey": "object:166", "refCount": 0, "refId": "C", - "target": "alias(scale(movingAverage(perSecond(keepLastValue(screeps.$User.gcl.progress)), 500), 86400), 'GCL / 24hr (avg)')", + "target": "alias(scale(movingAverage(perSecond(keepLastValue(screeps.$User.gcl.progress, 100)), 500), 86400), 'GCL / 24hr (avg)')", "textEditor": false } ], @@ -886,7 +741,7 @@ "h": 1, "w": 24, "x": 0, - "y": 27 + "y": 22 }, "id": 83, "panels": [], @@ -901,7 +756,7 @@ "label": "Others", "threshold": 0 }, - "datasource": "${DS_SCREEPSPLUS-GRAPHITE}", + "datasource": "ScreepsPlus-Graphite", "decimals": null, "fontSize": "70%", "format": "short", @@ -909,7 +764,7 @@ "h": 10, "w": 6, "x": 0, - "y": 28 + "y": 23 }, "id": 63, "interval": null, @@ -927,8 +782,9 @@ "strokeWidth": 1, "targets": [ { + "$$hashKey": "object:291", "refId": "A", - "target": "aliasByNode(sortByTotal(scale(movingAverage(perSecond(keepLastValue(screeps.$User.colonies.$colonies.rcl.progress)), 3600), 86400)), 3)", + "target": "aliasByNode(sortByTotal(scale(movingAverage(perSecond(keepLastValue(screeps.$User.colonies.$colonies.rcl.progress, 100)), 3600), 86400)), 3)", "textEditor": false } ], @@ -942,19 +798,21 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "${DS_SCREEPSPLUS-GRAPHITE}", + "datasource": "ScreepsPlus-Graphite", "fill": 1, "gridPos": { "h": 10, "w": 18, "x": 6, - "y": 28 + "y": 23 }, "id": 61, "legend": { "alignAsTable": true, "avg": false, "current": false, + "hideEmpty": true, + "hideZero": true, "max": false, "min": false, "rightSide": true, @@ -976,6 +834,7 @@ "steppedLine": false, "targets": [ { + "$$hashKey": "object:369", "refId": "A", "target": "aliasByNode(scale(movingAverage(perSecond(keepLastValue(screeps.$User.colonies.$colonies.rcl.progress)), 200), 86400), 3)", "textEditor": false @@ -1022,19 +881,21 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "${DS_SCREEPSPLUS-GRAPHITE}", + "datasource": "ScreepsPlus-Graphite", "fill": 0, "gridPos": { "h": 10, "w": 12, "x": 0, - "y": 38 + "y": 33 }, "id": 64, "legend": { "alignAsTable": true, "avg": false, "current": false, + "hideEmpty": true, + "hideZero": true, "max": false, "min": false, "rightSide": true, @@ -1056,6 +917,7 @@ "steppedLine": false, "targets": [ { + "$$hashKey": "object:539", "refId": "A", "target": "aliasByNode(keepLastValue(screeps.$User.colonies.$colonies.hatchery.uptime), 3)", "textEditor": false @@ -1103,19 +965,21 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "${DS_SCREEPSPLUS-GRAPHITE}", + "datasource": "ScreepsPlus-Graphite", "fill": 0, "gridPos": { "h": 10, "w": 12, "x": 12, - "y": 38 + "y": 33 }, "id": 62, "legend": { "alignAsTable": true, "avg": false, "current": false, + "hideEmpty": true, + "hideZero": true, "max": false, "min": false, "rightSide": true, @@ -1190,8 +1054,11 @@ "list": [ { "allValue": null, - "current": {}, - "datasource": "${DS_SCREEPSPLUS-GRAPHITE}", + "current": { + "text": "muon", + "value": "muon" + }, + "datasource": "ScreepsPlus-Graphite", "hide": 0, "includeAll": false, "label": "", @@ -1210,8 +1077,11 @@ }, { "allValue": null, - "current": {}, - "datasource": "${DS_SCREEPSPLUS-GRAPHITE}", + "current": { + "text": "All", + "value": "$__all" + }, + "datasource": "ScreepsPlus-Graphite", "hide": 0, "includeAll": true, "label": "Colonies", @@ -1270,5 +1140,5 @@ "timezone": "browser", "title": "Overmind", "uid": "000002135", - "version": 6 -} + "version": 28 +} \ No newline at end of file diff --git a/assets/Grafana Dashboards/installation.txt b/assets/Grafana Dashboards/installation.txt new file mode 100644 index 000000000..c89595469 --- /dev/null +++ b/assets/Grafana Dashboards/installation.txt @@ -0,0 +1,5 @@ +To set up Grafana dashboard: + +1. Register for grafana service at screepspl.us: https://screepspl.us/services/grafana +2. Setup grafana agent: https://github.com/bonzaiferroni/bonzAI/wiki/Screepspl.us-agent-with-Compute-Engine +3. Import Overmind.json dashboard and change $User to your username. (Make sure to use Grafana 5! screepspl.us/grafana5) \ No newline at end of file diff --git a/assets/basePlanner/spiral_bunker.txt b/assets/basePlanner/spiral_bunker.txt new file mode 100644 index 000000000..c3616618b --- /dev/null +++ b/assets/basePlanner/spiral_bunker.txt @@ -0,0 +1 @@ +{"name":"","shard":"shard0","rcl":8,"buildings":{"storage":{"pos":[{"x":23,"y":24}]},"terminal":{"pos":[{"x":25,"y":24}]},"nuker":{"pos":[{"x":24,"y":27}]},"tower":{"pos":[{"x":25,"y":25},{"x":23,"y":25},{"x":26,"y":25},{"x":22,"y":25},{"x":24,"y":26},{"x":24,"y":24}]},"powerSpawn":{"pos":[{"x":24,"y":21}]},"link":{"pos":[{"x":25,"y":26}]},"road":{"pos":[{"x":23,"y":23},{"x":24,"y":22},{"x":25,"y":23},{"x":26,"y":24},{"x":27,"y":25},{"x":26,"y":26},{"x":25,"y":27},{"x":24,"y":28},{"x":23,"y":27},{"x":22,"y":26},{"x":21,"y":25},{"x":22,"y":24},{"x":24,"y":25},{"x":26,"y":20},{"x":27,"y":20},{"x":28,"y":21},{"x":29,"y":22},{"x":29,"y":23},{"x":28,"y":24},{"x":23,"y":21},{"x":22,"y":20},{"x":19,"y":23},{"x":29,"y":27},{"x":29,"y":28},{"x":28,"y":29},{"x":27,"y":30},{"x":26,"y":30},{"x":25,"y":29},{"x":19,"y":22},{"x":20,"y":21},{"x":21,"y":20},{"x":20,"y":26},{"x":19,"y":27},{"x":19,"y":28},{"x":20,"y":29},{"x":21,"y":30},{"x":22,"y":30},{"x":18,"y":19},{"x":19,"y":19},{"x":20,"y":19},{"x":22,"y":19},{"x":21,"y":19},{"x":23,"y":19},{"x":25,"y":19},{"x":26,"y":19},{"x":27,"y":19},{"x":28,"y":19},{"x":29,"y":19},{"x":30,"y":19},{"x":30,"y":20},{"x":30,"y":21},{"x":30,"y":21},{"x":30,"y":22},{"x":30,"y":23},{"x":30,"y":24},{"x":30,"y":25},{"x":30,"y":26},{"x":30,"y":27},{"x":30,"y":29},{"x":30,"y":29},{"x":30,"y":28},{"x":30,"y":30},{"x":30,"y":31},{"x":30,"y":31},{"x":29,"y":31},{"x":28,"y":31},{"x":27,"y":31},{"x":26,"y":31},{"x":26,"y":31},{"x":25,"y":31},{"x":23,"y":31},{"x":22,"y":31},{"x":21,"y":31},{"x":20,"y":31},{"x":19,"y":31},{"x":18,"y":31},{"x":18,"y":30},{"x":18,"y":29},{"x":18,"y":28},{"x":18,"y":27},{"x":18,"y":26},{"x":18,"y":25},{"x":18,"y":23},{"x":18,"y":24},{"x":18,"y":22},{"x":18,"y":21},{"x":18,"y":20},{"x":23,"y":26}]},"observer":{"pos":[{"x":24,"y":23}]},"lab":{"pos":[{"x":25,"y":22},{"x":26,"y":23},{"x":27,"y":24},{"x":26,"y":22},{"x":26,"y":21},{"x":27,"y":22},{"x":27,"y":23},{"x":28,"y":23},{"x":27,"y":21},{"x":28,"y":22}]},"extension":{"pos":[{"x":23,"y":22},{"x":22,"y":23},{"x":21,"y":24},{"x":21,"y":23},{"x":22,"y":22},{"x":22,"y":21},{"x":21,"y":22},{"x":20,"y":23},{"x":23,"y":20},{"x":24,"y":20},{"x":25,"y":20},{"x":29,"y":24},{"x":29,"y":25},{"x":29,"y":26},{"x":19,"y":24},{"x":19,"y":25},{"x":19,"y":26},{"x":21,"y":21},{"x":20,"y":22},{"x":27,"y":26},{"x":28,"y":27},{"x":27,"y":27},{"x":26,"y":27},{"x":26,"y":28},{"x":27,"y":28},{"x":28,"y":28},{"x":27,"y":29},{"x":26,"y":29},{"x":25,"y":28},{"x":21,"y":26},{"x":22,"y":27},{"x":23,"y":28},{"x":22,"y":28},{"x":21,"y":27},{"x":20,"y":27},{"x":21,"y":28},{"x":22,"y":29},{"x":21,"y":29},{"x":20,"y":28},{"x":23,"y":30},{"x":24,"y":30},{"x":25,"y":30},{"x":28,"y":20},{"x":29,"y":20},{"x":29,"y":21},{"x":20,"y":20},{"x":19,"y":21},{"x":19,"y":20},{"x":19,"y":30},{"x":19,"y":29},{"x":20,"y":30},{"x":29,"y":29},{"x":28,"y":30},{"x":29,"y":30},{"x":28,"y":26},{"x":20,"y":24},{"x":25,"y":21},{"x":23,"y":29},{"x":24,"y":19},{"x":24,"y":31}]},"spawn":{"pos":[{"x":28,"y":25},{"x":20,"y":25},{"x":24,"y":29}]}}} \ No newline at end of file