-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved short polling. Cached cluster data for 30mins with "forceRef…
…resh" option. Externalised server-side defaults into environment-based configuration files. UI: - Implemented short polling logic - query the server up to 120 times with 5s intervals - Added "Reload Server Cache" button to UI to force server to refresh cluster data. - Upgraded bootstrap from v3.3.5 to v3.3.7 for glyphicons including "glyphicons-halflings-regular" fonts. - Improved error handling. Server: - Externalised server-side defaults into environment-based configuration files. - Added ClusterState & ClusterStateCache to cache cluster data. - Added FetchStatus to represent current status of fetching cluster data. - Improved error handling. - Added test suite - run tests with "npm run test"
- Loading branch information
1 parent
a239748
commit 4ec2c72
Showing
29 changed files
with
1,372 additions
and
141 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
@startuml | ||
skinparam sequenceArrowThickness 2 | ||
skinparam roundcorner 20 | ||
skinparam maxmessagesize 60 | ||
skinparam sequenceParticipant underline | ||
|
||
actor User | ||
participant "Browser" as A | ||
participant "Request" as B | ||
participant "Background Processing" as C | ||
participant "ClusterStateCache" as D | ||
|
||
activate D | ||
|
||
User -> A: Select Cluster | ||
activate A | ||
|
||
A -> B: "/api/instance_summaries_with_tasks" | ||
activate B | ||
|
||
B -> C: Get State | ||
activate C | ||
C -> D: Create | ||
activate D | ||
C -> D: INITIAL | ||
C --> B: INITIAL | ||
|
||
B --> A: INITIAL | ||
deactivate B | ||
|
||
C -> D: FETCHING | ||
|
||
A -> B: "/api/instance_summaries_with_tasks" | ||
activate B | ||
B -> C: Get State | ||
C --> B: FETCHING | ||
B --> A: FETCHING | ||
deactivate B | ||
|
||
C -> D: FETCHED | ||
|
||
A -> B: "/api/instance_summaries_with_tasks" | ||
activate B | ||
B -> C: Get State | ||
C --> B: FETCHED | ||
B --> A: FETCHED | ||
deactivate B | ||
|
||
D -> D : Expire | ||
deactivate D | ||
|
||
A --> User: Render Graph | ||
deactivate A | ||
|
||
|
||
deactivate C | ||
deactivate D | ||
|
||
@enduml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
@startuml | ||
|
||
'[*] --> null | ||
[*] --> INITIAL | ||
INITIAL --> FETCHING | ||
FETCHING --> FETCHED | ||
'INITIAL --> null : Expired | ||
'FETCHING --> null : Expired | ||
'FETCHED --> null : Expired | ||
'ERROR --> null : Expired | ||
INITIAL --> ERROR : Failed | ||
FETCHING --> ERROR : Failed | ||
FETCHED --> ERROR : Failed | ||
|
||
'FETCHED --> [*] : Success | ||
'ERROR --> [*] : Error | ||
|
||
@enduml | ||
|
||
@startuml | ||
|
||
[*] --> null | ||
null --> INITIAL | ||
INITIAL --> FETCHING | ||
FETCHING --> FETCHED | ||
INITIAL --> null : Expired | ||
FETCHING --> null : Expired | ||
FETCHED --> null : Expired | ||
ERROR --> null : Expired | ||
INITIAL --> ERROR | ||
FETCHING --> ERROR | ||
FETCHED --> ERROR | ||
|
||
'FETCHED --> [*] : Success | ||
'ERROR --> [*] : Error | ||
|
||
@enduml | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const _ = require('lodash'); | ||
|
||
// Assume running in 'dev' environment if NODE_ENV environment variable not defined | ||
const targetEnvironment = (process.env.NODE_ENV || 'dev'); | ||
|
||
// Load default configuration from defaults.js | ||
// and extend with environment-specific configuration | ||
module.exports = _.merge( | ||
require('./defaults.js'), | ||
require(`./env/${targetEnvironment}.js`) || {} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module.exports = { | ||
port: process.env.PORT || 3000, | ||
clusterStateCacheTtl: 30 * 60 * 1000, // Invalidate clusters in cache after 30 minutes | ||
aws: { | ||
configFile: './aws_config.json', | ||
apiDelay: 100, // milliseconds to pause between AWS API calls to prevent API rate limiting | ||
listInstancesPageSize: 100, // max 100 | ||
describeInstancesPageSize: 100, // max 100 | ||
listTasksPageSize: 100, // max 100 | ||
describeTasksPageSize: 100, // max 100 | ||
maxSimultaneousDescribeTasksCalls: 2, | ||
maxSimultaneousDescribeTaskDefinitionCalls: 1, | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
// add dev environment config overrides here and enable at startup with NODE_ENV=dev environment variable | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
// add production environment config overrides here and enable at startup with NODE_ENV=prod environment variable | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
// add test environment config overrides here and enable at startup with NODE_ENV=test environment variable | ||
}; |
Oops, something went wrong.