Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quick fix to allow continuous monitoring #124

Merged
merged 27 commits into from
May 19, 2022
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
693c376
start populating Readme
Nov 24, 2021
3906cb7
start populating Readme
Nov 24, 2021
7f55ed9
start populating Readme
Nov 24, 2021
3a9d872
Update README.md
schlotze May 4, 2022
5f5b87c
Update README.md
schlotze May 4, 2022
cc6b418
Update README.md
schlotze May 5, 2022
34bde82
Update README.md
schlotze May 5, 2022
141c661
Update README.md
schlotze May 5, 2022
09f5cae
Update README.md
schlotze May 5, 2022
f8030ae
Update README.md
schlotze May 5, 2022
a4c7216
add wait-for-it script to container image
reimer-atb May 6, 2022
8717b10
add sample for running smartclide-monitoring locally
reimer-atb May 6, 2022
4d70d94
Update README.md
schlotze May 9, 2022
666e469
Update README.md
schlotze May 9, 2022
c9b851d
Update README.md
schlotze May 10, 2022
f9e9315
Update README.md
schlotze May 10, 2022
95410c4
Update README.md
schlotze May 10, 2022
891242f
Merge branch 'main' into update_readme
schlotze May 10, 2022
d0adced
Merge branch 'update_readme' into main
schlotze May 10, 2022
48aa99d
Merge branch 'main' of github.com:eclipse-researchlabs/smartclide-con…
schlotze May 18, 2022
13c6ba8
Merge branch 'main' of github.com:eclipse-researchlabs/smartclide-con…
schlotze May 18, 2022
4a20599
quick fix to avoid errors if parentCommitId contains more than 1 comm…
schlotze May 18, 2022
a3d994f
simplify
schlotze May 19, 2022
f8d9648
revert
reimer-atb May 6, 2022
05877d6
revert
reimer-atb May 6, 2022
70a33f9
restore README
reimer-atb May 19, 2022
f019d9d
minor formatting changes
reimer-atb May 19, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion samples/config/monitoring-config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<datasource id="datasource-git" type="messagebroker"
monitor="de.atb.context.monitoring.monitors.GitMonitor"
uri=""
options="server=rabbitmq&amp;port=5672&amp;exchange=smartclide-monitoring&amp;topic=monitoring.git.*&amp;dle-topic=dle.git.commits"
options="server=rabbitmq&amp;port=5672&amp;exchange=smartclide-monitoring&amp;outgoing-topic=monitoring.git.*"
schlotze marked this conversation as resolved.
Show resolved Hide resolved
class="de.atb.context.monitoring.config.models.datasources.MessageBrokerDataSource"/>
</datasources>

Expand Down
44 changes: 22 additions & 22 deletions samples/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,31 @@ services:
networks:
- smartclide-monitoring
# smartclide-monitoring
smartclide-monitoring:
image: ghcr.io/eclipse-researchlabs/smartclide/smartclide-monitoring:latest
depends_on:
- rabbitmq
volumes:
# smartclide-monitoring:
schlotze marked this conversation as resolved.
Show resolved Hide resolved
# image: ghcr.io/eclipse-researchlabs/smartclide/smartclide-monitoring:latest
# depends_on:
# - rabbitmq
# volumes:
# configuration files are mounted to '/opt/smartclide/config'
# see eu.smartclide.contexthandling.ServiceMain for other options
- ./config:/opt/smartclide/config
# - ./config:/opt/smartclide/config
# waits for rabbitmq datasource to be available before starting smartclide-monitoring
entrypoint:
[
"/entrypoint.d/wait-for-it.sh",
"rabbitmq:5672",
"--strict",
"-t",
"30",
"--",
"java",
"-Djava.security.egd=file:/dev/./urandom",
"-cp",
"app/libs/*:app/resources:app/classes",
"eu.smartclide.contexthandling.ServiceMain",
]
networks:
- smartclide-monitoring
# entrypoint:
# [
# "/entrypoint.d/wait-for-it.sh",
# "rabbitmq:5672",
# "--strict",
# "-t",
# "30",
# "--",
# "java",
# "-Djava.security.egd=file:/dev/./urandom",
# "-cp",
# "app/libs/*:app/resources:app/classes",
# "eu.smartclide.contexthandling.ServiceMain",
# ]
# networks:
# - smartclide-monitoring

networks:
smartclide-monitoring:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ private int calculateTimeSinceLastCommit(String projectId, JsonObject commit) {
int difference = 0;
// check if parent id exists for given commit
if (commit.get("parent_ids").getAsJsonArray().size() > 0) {
String parentCommitId = commit.get("parent_ids").getAsString();
String parentCommitId;
parentCommitId = commit.get("parent_ids").getAsJsonArray().get(0).getAsString();
String commitCreationDateStr = commit.get("created_at").getAsString();
JsonObject parentCommit = getCommitById(projectId, parentCommitId);
if (parentCommit.getAsJsonObject().has("created_at")) {
Expand All @@ -128,7 +129,7 @@ private int calculateTimeSinceLastCommit(String projectId, JsonObject commit) {
ZonedDateTime commitCreationDate = ZonedDateTime.parse(commitCreationDateStr, formatter);
ZonedDateTime parentCommitCreationDate = ZonedDateTime.parse(parentCommitCreationDateStr, formatter);
long longDifference = commitCreationDate.toInstant().getEpochSecond() -
parentCommitCreationDate.toInstant().getEpochSecond();
parentCommitCreationDate.toInstant().getEpochSecond();
if (longDifference <= (long) Integer.MAX_VALUE) {
difference = (int) longDifference;
}
Expand Down