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

Return subtask map #1

Merged
merged 2 commits into from
Jun 30, 2021
Merged

Return subtask map #1

merged 2 commits into from
Jun 30, 2021

Conversation

matchand-nokia
Copy link

@matchand-nokia matchand-nokia commented Jun 24, 2021

Goal: What I set out to accomplish was to be able to publish each job's subtask queue times to grafana, using the InfluxDB plugin in order to send that data over.

A subtask is essentially a chunk of code that a specific executor is tasked to finish. grafana is used to plot data on visual data charts (scatter plots, line graphs, etc).

The metrics plugin handles information in regards to subtask queue time. Turns out InfluxDB uses metrics in order to get these queue times, so I had to modify metrics to send the correct data over to InfluxDB.

My modifications included one function in TimeInQueueAction.java: getSubTaskMap()

Screenshot from 2021-06-24 16-21-02

getSubTaskMap() makes a hash map that takes the subtask's relative order and maps it to the subtask queue time. Each subtask is given a number based on the order of when each one first entering the queue. This is the order that is determined by calling run.getActions(SubTaskTimeInQueueAction.class), which returns a list where the subtasks are already in said order. A simple counter variable is used to keep track of the relative order, and is appended to each of the subtask keys as an identifier. Each subtask is then paired with its time in queue and inserted into the hash map. When the function completes, it will return a map of all the subtasks with their queue times.

pom.xml Outdated Show resolved Hide resolved
matchand-nokia added a commit that referenced this pull request Jun 24, 2021
@matchand-nokia matchand-nokia merged commit feb20c5 into master Jun 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants