Giter Club home page Giter Club logo

Comments (3)

ngzhian avatar ngzhian commented on June 27, 2024

It seems like this line

String sampleDMax = selectParameterFromNode(sample, "dmax", "0");

is causing trouble, its return value should be "0", since dmax isn't in the sample jmxetric_text.xml file. For somehow it returns "".

from jmxetric.

ngzhian avatar ngzhian commented on June 27, 2024

Think I've found the problem. In jmxetric_test.xml, we have the following doctype

   <!ELEMENT sample (mbean)*>
      <!ATTLIST sample delay CDATA #REQUIRED>
      <!ATTLIST sample dmax CDATA "" >

This meant that dmax is always going to be present, with a default value of "". Hence the method selectParameterFromNode in XMLConfigurationService:

            Node node = ganglia.getAttributes().getNamedItem(attributeName);
            if ( node != null ) {
                String value = node.getNodeValue();
                if ( value != null )
                    ret = value ;
            }

would return "", as node is never null for dmax, since a default value was given in the XML doctype.

2 ways to fix this:

  1. remove that attribute from sample
  2. give it a default string of "0", because that's what the code does anyway

Referencing the initialdelay attribute in etc/jmxetric.xml, it seems that 2. is a better way:

   <!ELEMENT sample (mbean)*>
      <!ATTLIST sample delay CDATA #REQUIRED>
      <!ATTLIST sample initialdelay CDATA "0">
      <!ATTLIST sample dmax CDATA "" >

and note that dmax has an empty default string here as well.

@dpocock which way would be suitable?

from jmxetric.

dpocock avatar dpocock commented on June 27, 2024

I would suggest two things:

  • fix the default in the sample, change it to "0"
  • some people may have already copied that sample and may not notice the fix. Therefore, I think that in the code it should check if sampleDMax.equals("") and if so replace it with 0

from jmxetric.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.