wernerdv commented on PR #13831:
URL: https://github.com/apache/ignite/pull/13831#issuecomment-6928071626

   Tests
   
   1. Move the CDC test out of the parameterized class. 
CdcSelfTest.testLogCountMetrics (CdcSelfTest.java:182) runs 12 times through 
the parameters (CdcSelfTest.java:132-142), plus 12 more through 
TransformedCdcSelfTest extends CdcSelfTest (TransformedCdcSelfTest.java:30). 
None of the parameters affect the log counters. Move it to 
CdcPushMetricsExporterTest. That class has no parameters, already tests CDC 
metric export with JMX, and is in the same suite, IgnitePdsTestSuite2.
   2. Remove the duplicate test. 
GridLoggerProxyMetricsTest.testUpdatesAfterRegistration (:90) is already 
covered by testLogMessagesMetrics (counts made before registration are kept) 
and testSharedCategoriesAndIndependentRoots (counts made after registration).
   3. Remove duplicate checks in the CDC test:
      - the nodeBean loop over the node's JMX attributes, which 
JmxExporterSpiTest.testLogCountMetrics (:212) already checks;
      - assertNotSame(nodeError, cdcError) (CdcSelfTest.java:219), which adds 
nothing beyond the value checks after it.
   
   Code
   
   4. IgniteKernal: drop the extra condition. Remove if 
(ctx.metric().enabled()) at IgniteKernal.java:1207 and call 
log.registerMetrics(ctx.metric()) inside registerMetrics() (:3352), which 
already starts with the same check.
   5. CdcMain: decide whether the condition is needed. if 
(kctx.metric().enabled()) at CdcMain.java:410 doesn't match the cdc registry 
next to it, which is created without a condition (:413). Either remove it or 
justify it.
   6. Make the metric descriptions match the docs. In 
GridLoggerProxy.java:332-344, "Total number of TRACE log messages." should say 
the count only grows while the level is enabled. JMX and SYS.METRICS users see 
this text.
   7. Optional: skip the throwaway counters. The no-arg constructor 
(GridLoggerProxy.java:83-85) creates 5 counters that readResolve() (:306) 
immediately discards. It's harmless, so this is a cosmetic fix.
   
   Docs
   
   8. Update the CDC docs.
      - In change-data-capture.adoc:117-122, add that CDC also registers 
log.count.
      - In new-metrics.adoc:803, add log.count to the list of CDC registers.
   9. Fix the user-facing wording. In new-metrics.adoc:808, replace the 
internal term "logger proxies" with something like "the node's logger".
   10. Document the side effects of wrapping the CDC logger (CdcMain.java:277), 
in the docs or at least the PR description:
       - With IGNITE_LOG_INSTANCE_NAME or IGNITE_LOG_GRID_NAME set, every CDC 
log line now gets a <cdc-<name>> prefix. The new id8 == null branch in enrich() 
(GridLoggerProxy.java:280-284) exists for this case and no test covers it.
       - In quiet mode, the CDC banner now prints ^-- Logging by '...' 
(CdcMain.java:966-967). That code never ran before.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to