Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Fault detection stats #291

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Fault detection stats #291

wants to merge 4 commits into from

Conversation

amathur1893
Copy link
Contributor

@amathur1893 amathur1893 commented Mar 9, 2021

The changes are made in accordance of how we are getting fault detection metrics from ES. Fault Detection metrics in ES will be published in a manner similar to ingest metrics. Hence changing collector and processor accordingly.
Fixes #:

  1. Tested using Docker

Tmp file

^fault_detection
{"current_time":1615283839364}
{"FollowerCheck_Latency":1.28,"LeaderCheck_Latency":1.8,"FollowerCheck_Failure":3.0,"LeaderCheck_Failure":4.0}$

Table created

sqlite> .tables
FollowerCheck_Latency     
FollowerCheck_Failure
LeaderCheck_Latency     
LeaderCheck_Failure

Contents of the table

sqlite> select * from LeaderCheck_Latency;
1.8|1.8|1.8|1.8
sqlite> select * from FollowerCheck_Latency;
1.28|1.28|1.28|1.28
sqlite> select * from LeaderCheck_Failure;
4.0|4.0|4.0|4.0
sqlite> select * from FollowerCheck_Failure;
3.0|3.0|3.0|3.0

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or

(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or

(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.

(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.

Comment on lines +128 to +131
Coordinator coordinator = (Coordinator) discovery;
Field leaderCheckerField = Coordinator.class.getDeclaredField(LEADER_CHECKER_FIELD);
leaderCheckerField.setAccessible(true);
LeaderChecker leaderChecker = (LeaderChecker) leaderCheckerField.get(coordinator);
Copy link

@ashwinpankaj ashwinpankaj Mar 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this reflection code be refactored outside collectMetrics so that it is run only once?

static {
mapper = new ObjectMapper();
mapper.setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY);
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
Copy link

@ashwinpankaj ashwinpankaj Mar 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a specific reason for disabling this?

StringBuilder value = new StringBuilder();
value.append(PerformanceAnalyzerMetrics.getJsonCurrentMilliSeconds())
.append(PerformanceAnalyzerMetrics.sMetricNewLineDelimitor);
value.append(faultDetectionMetrics.serialize());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be combined with the previous statement.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants