Dockerized application for planned of switching between another diagnostic web applications.
10K+
Dockerized application for planned of switching between another diagnostic web applications.
Milestones, Issue, Pull Requests, IDEAS / Backlog Issue tracker, questions or ideas.
Currently this application contains many amazing community projects, such as:
This application is dockerized and here is Kubernetes recipe
After clone this repository, you see:
monitor/
README.md
.babelrc - config for babeljs
.dockerignore - exclude directory when creating docker image
.gitignore
Dockerfile - recipe for create dockerized application
kubernetes.yaml - recipe for run dockerized application in Kubernetes environment
package.json - recipe for CLI instalation
server.json - backend layer
app/ - tv4 validator and query for elasticsearch
build/ - production build
e2eTests/ - support only Harness test stack via Selenium
public/ - static files
src/ - frontend application
tests/ - integration tests and random data filler for manual testing
After run application, your see additional files and directories.
In nodeJS / Yarn environment:
yarn client run frontend part applicationELASTIC_URI=http://IP:9200 yarn server run backend part applicationTZ=Pacific/Bougainville default: Europe/Pragueyarn unit run unit tests and watcher ( for development )yarn filldata remove old slots from elasticsearch and create a new slots by counter. This is extended integration tests.yarn integration run integration testsyarn start run application for production environmentThis project contains many tests, e.g. unit tests, e2e and integration tests
run via yarn unit
monitor/
src/
components/
*.test.jsx
run via Harness e2e test-stack environment
PWD/e2eTests/:/home/harness rdpanek/docker_harness:1.6Integration tests for endpoint API /api/slots.
Run via yarn integration
monitor/
tests/
slots.js
For development:
ELASTIC_URI=http://IP:9200 yarn server - backend partyarn client - backend clientFor production use:
yarn startRe-build Docker image:
- or -
then run
run image: docker run --name monitor -d -e TZ=Europe/Prague -e ELASTIC_URI=xxx.xxx.xxx.xxx:9200 -p 3000:3000 -p 3001:3001 rdpanek/monitor:0.3.0
Fill ELASTIC_URI and run
kubectl create -f kubernetes.yaml
and check log
kubectl logs -f pod
This application has a WEB and REST-API interface. When is application run, then schedulled presentations is available on default URI IP:PORT. Administration interface is available on uri IP:PORT/#/admin
Browser interface allows to displayed schedulled presentations or Administration interface.
Administration interface contains Timeline, which show schedulled presentations, so called Time Slots added via form CREATE SLOT and Background Time Slots added via REST-API.
If exist Time Slot and Background Time Slot in the same time, then Background Time Slot has higher priority, so in Presentation view will be show the Background Time Slot.
Click on CREATE SLOT button show intuitive dialogue for create Time Slot. To field URI must contain URI web application. Beware of X-FRAME-OPTIONS in headers. Fields from and to must be unique for Time Slot and Banckground Time Slots. Colors is useful for identification more Time Slots on Timeline. Background Time Slots has predefined color.
REST-API is useful for sending command for show presentation from other tools., e.g. Show Kibana Dashboard with latests results of performance tests from now to 10min laters.
You can use REST-API endpoint IP:3001/api/slots and send this payload
{
"from": "09:58:30",
"to": "09:58:40",
"color": "background",
"title": "Performance tests analysis summary | Smoke",
"type": "background",
"uri": "http://my-kibana.xyz:31159/goto/254cb2303c9dca4d3786eaa9bc8ae5e1"
}
The form of this payload must remain unchanged. You can change only:
from format: HH:mm:ssto format: HH:mm:sstitle is useful for Presentation layer, when a banner is displayed with the name of the application to be displayed. Title is used in Timeline for name of Time Slots and Background Time Slotsuri Beware of X-FRAME-OPTIONS in headers.The Background Time Slots has higgher priority than Time Slots. When is time to show Background Time Slot, is shown instead Time Slots.
Response must contain property created with value true
Api contains endpoint POST /api/slots/generator for create lot of more Time Slots via generator definition in JSON format.
You can use REST-API endpoint IP:3001/api/slots/generator and send this payload
Request
{
"duration": 360,
"timeSlots": [{
"duration": 60,
"title": "Application A",
"uri": "http://"
},{
"delay": 120,
"duration": 60,
"title": "Application B",
"uri": "http://"
}]
}
The form of this payload must remain unchanged. You can change only:
duration in seconds - is time range ( from now to +duration ) for all new time slotstimeSlots.delay in seconds - is optional and shifts the start time ( now + delay )timeSlots.duration in seconds - is time range ( from now to +duration ) for this time slottimeSlots.title is useful for Presentation layer, when a banner is displayed with the name of the application to be displayed. Title is used in Timeline for name of Time Slots and Background Time Slotsuri Beware of X-FRAME-OPTIONS in headers.Response
{
"timeSlots": [
{
"timeSlot": {
"duration": 60,
"title": "Application A",
"uri": "http://",
"from": "14:01:35",
"to": "14:02:35",
"timeRangeSlotValidator": true
},
"saved": {
"_index": "monitor-slots",
"_type": "monitor-slots",
"_id": "1497873695687",
"_version": 1,
"result": "created",
"_shards": {
"total": 2,
"successful": 1,
"failed": 0
},
"created": true
}
},
{
"timeSlot": {
"delay": 120,
"duration": 60,
"title": "Application B",
"uri": "http://",
"from": "14:02:35",
"to": "14:03:35",
"timeRangeSlotValidator": true
},
"saved": {
"_index": "monitor-slots",
"_type": "monitor-slots",
"_id": "1497873695688",
"_version": 1,
"result": "created",
"_shards": {
"total": 2,
"successful": 1,
"failed": 0
},
"created": true
}
},
{
"timeSlot": {
"duration": 60,
"title": "Application A",
"uri": "http://",
"from": "14:03:35",
"to": "14:04:35",
"timeRangeSlotValidator": true
},
"saved": {
"_index": "monitor-slots",
"_type": "monitor-slots",
"_id": "1497873695689",
"_version": 1,
"result": "created",
"_shards": {
"total": 2,
"successful": 1,
"failed": 0
},
"created": true
}
},
{
"timeSlot": {
"delay": 120,
"duration": 60,
"title": "Application B",
"uri": "http://",
"from": "14:04:35",
"to": "14:05:35",
"timeRangeSlotValidator": true
},
"saved": {
"_index": "monitor-slots",
"_type": "monitor-slots",
"_id": "1497873695690",
"_version": 1,
"result": "created",
"_shards": {
"total": 2,
"successful": 1,
"failed": 0
},
"created": true
}
},
{
"timeSlot": {
"duration": 60,
"title": "Application A",
"uri": "http://",
"from": "14:05:35",
"to": "14:06:35",
"timeRangeSlotValidator": true
},
"saved": {
"_index": "monitor-slots",
"_type": "monitor-slots",
"_id": "1497873695691",
"_version": 1,
"result": "created",
"_shards": {
"total": 2,
"successful": 1,
"failed": 0
},
"created": true
}
},
{
"timeSlot": {
"delay": 120,
"duration": 60,
"title": "Application B",
"uri": "http://",
"from": "14:06:35",
"to": "14:07:35",
"timeRangeSlotValidator": true
},
"saved": {
"_index": "monitor-slots",
"_type": "monitor-slots",
"_id": "1497873695692",
"_version": 1,
"result": "created",
"_shards": {
"total": 2,
"successful": 1,
"failed": 0
},
"created": true
}
}
],
"endTime": "14:07:35",
"processingTime": {
"ms": 566
}
}
The reply contains the generator job report. Each time slot is completed in generator about some next labels:
timeSlots.timeSlot.from - from is now or value from label to from last time slot in one generator definitiontimeSlots.timeSlot.to - is (now + timeSlots.duration) and this value is use in from in next time slottimeSlots.timeSlot.timeRangeSlotValidator - each a new time slot with new time range from and to is passed through the time range validator. Result is true or false and completed in next label message with description of reason {"freeSlotAvailable": false,"message": "TimeRangeSlotValidate: The time range is occupied or its beginning or ending interferes with the existing time slot"}timeSlots.saved.created is true if is save time slot is successful. If timeSlots.timeSlot.timeRangeSlotValidator is false, then timeSlots.save is also falseThe Time Slot Generator generate only Background Time Slots.
Api contains endpoint PUT /api/settings update settings and unpause Message Box on Presentation page.
You can use REST-API endpoint IP:3001/api/settings and send this payload
Request
{
"generatorSlotValidatorAllow": false,
"color": "Warning",
"endTime": "2017-09-07T13:54:30",
"message": "TEST2 is down!"
}
The form of this payload must remain unchanged. You can change only:
generatorSlotValidatorAllow [false|true] allow turn on slot validator for new time slots generatorcolor ["Warning"|"Success"|"Notice"] - color of Message BoxendTime from now to endTimemessage Message box textResponse
{
"elastic": {
"_index": "monitor-settings",
"_type": "monitor-settings",
"_id": "1504784963509",
"_version": 12,
"result": "updated",
"_shards": {
"total": 2,
"successful": 1,
"failed": 0
}
}
}
"successful": 1 update was successfulTime Slots and Background Time Slots is stored in elasticsearch in monitor-slots index. If not exist, it will be automatically created.
Content type
Image
Digest
Size
124.3 MB
Last updated
about 9 years ago
docker pull rdpanek/monitor