-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add a metric for diagram generations in the thread pool #131
base: main
Are you sure you want to change the base?
Conversation
274d483
to
6e3e4f3
Compare
6e3e4f3
to
46852fa
Compare
Signed-off-by: Slimane AMAR <amarsli@gm0winl104.bureau.si.interne>
46852fa
to
a6181a1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some code comments, will test tomorrow
* @author Slimane Amar <slimane.amar at rte-france.com> | ||
*/ | ||
@Service | ||
public class DiagramGenerationExecutionService { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe NetworkAreaExecutionService as it's not used for the SLD?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
MultiGauge multiGauge = MultiGauge.builder(TASK_POOL_METER_NAME).description("The number of diagram generations (tasks) in the thread pool").register(meterRegistry); | ||
multiGauge.register(List.of( | ||
MultiGauge.Row.of(Tags.of(TASK_TYPE_TAG_NAME, TASK_TYPE_TAG_VALUE_CURRENT), threadPoolExecutor::getActiveCount), | ||
MultiGauge.Row.of(Tags.of(TASK_TYPE_TAG_NAME, TASK_TYPE_TAG_VALUE_PENDING), () -> threadPoolExecutor.getQueue().size()) | ||
)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure to understand why we need a multigauge here as the number of tags is constant and equal to 2. From my understanding multigauge are useful if the number of tags vary.
Here, it seems simpler to have two gauges (one for current, one for pending)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wiith Jauge.builder we can't have a value supplier different for different tags !
|
||
@Autowired | ||
private SingleLineDiagramService singleLineDiagramService; | ||
private final DiagramGenerationExecutionService diagramExecutionService; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why inject this here and not in the service directly ?
Move diagramExecutionService in NetworkAreaDiagramService.java?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
return diagramExecutionService | ||
.supplyAsync(() -> networkAreaDiagramService.getNetworkAreaDiagramSvg(networkUuid, variantId, voltageLevelsIds, depth, withGeoData)) | ||
.get(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this could simplify to
return diagramExecutionService | |
.supplyAsync(() -> networkAreaDiagramService.getNetworkAreaDiagramSvg(networkUuid, variantId, voltageLevelsIds, depth, withGeoData)) | |
.get(); | |
return networkAreaDiagramService.getNetworkAreaDiagramSvg(networkUuid, variantId, voltageLevelsIds, depth, withGeoData)); |
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we want it to be used for SLD and NAD, it makes sense to have it here. But from the code, it looks specialized to NAD.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
68a392f
to
22916da
Compare
22916da
to
3924027
Compare
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code OK
No description provided.