Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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()
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.