1 2 Previous Next 15 Replies Latest reply on Oct 29, 2007 3:18 AM by abdujaparov

    Deployed service statistics

      Hi, I've deployed some services on jbossws, when I view the list of deployed services there are the statistics of every service such as number of request, respons time etc etc, how can I get these statistics? Have jboss some apis? If yes, where can I find these apis?
      Thanks.
      Bye bye.

        • 1. Re: Deployed service statistics
          asoldano

          The statistics you see in the deployed service list page are currently also available through a MBean for each endpoint (ManagedEndpoint). You can access them programmatically via JMX; moreover they're of course showed in the jmx-console under the jboss.ws domain.
          If you think something else should be added to those statistics or simply want to know what we're working on concerning this, please read this
          http://www.jboss.com/index.html?module=bb&op=viewtopic&t=121473
          and feel free to comment!
          Thank you

          • 2. Re: Deployed service statistics
            asoldano

            Also consider we still have to fix this http://jira.jboss.org/jira/browse/JBWS-1855, but I'm quite confident it will be resolved soon.

            • 3. Re: Deployed service statistics

              Hi Alessio, I've read what you have highlited but I don't understand a lot.
              Does a tutorial/guide exist? If yes, where can I find it?
              With that informations I remain at the beginning point.
              Thanks, bye bye.

              • 4. Re: Deployed service statistics
                asoldano

                Hi,
                unfortunately no tutorial available on this right now; however, once you understand a bit about JMX, it's quite straightforward.
                I suggest you to search a bit about jmx technology on the Internet.
                A brief JMX-console introduction is available here: http://wiki.jboss.org/wiki/Wiki.jsp?page=JMXConsole
                For sure in future we'll enhance our documentation covering this issues too, as said in the productivity threads mentioned above. If you think something in particular should be done, feel free to comment there.

                • 5. Re: Deployed service statistics
                  oskar.carlstedt

                  Hi!

                  Just take a look in the source code for the jbossws web application and you´re up and running. It's really simple when you find the correct source.

                  Anyway, here is a code snippet ...

                  // get SPI provider and endpoint registry
                  SPIProvider spiProvider = SPIProviderResolver.getInstance()
                   .getProvider();
                  EndpointRegistry epRegistry = spiProvider.getSPI(
                   EndpointRegistryFactory.class).getEndpointRegistry();
                  
                  // loop over all endpoints
                  Set<ObjectName> objectNames = epRegistry.getEndpoints();
                  for (ObjectName objectName : objectNames) {
                  
                   // get the endpoint by using its name
                   Endpoint endpoint = epRegistry.getEndpoint(objectName);
                  
                   ...
                  }
                  



                  Cheers,
                  Oskar


                  • 6. Re: Deployed service statistics

                    Hi!

                    I begin to study jmx, I hope to understand something, the code posted by oskar permits to take the list of web service deployed on jboss?

                    A question, has jbossws statistics about each operation (ex: number of request of operation echo(String) of service Pippo) of the service or only the general statistics of a service (ex: number of request of service Pippo)?
                    Thanks!
                    Bye Bye.

                    • 7. Re: Deployed service statistics

                      Hi Oskar!
                      What are the jar files of that classes and what are the packages?
                      What do I obtain with that classes?
                      Thanks, bye bye.

                      • 8. Re: Deployed service statistics
                        oskar.carlstedt
                        • 9. Re: Deployed service statistics

                          Hi Oskar, with this classes what do I obtain?
                          Thanks, bye bye.

                          • 10. Re: Deployed service statistics
                            asoldano

                            Hi abdujaparov,
                            what Oskar is telling you is that instead of using JMX to access the managed endpoint MBean, you might leverage our spi to get the metrics you're looking for.
                            As a matter of fact, once you get the org.jboss.wsf.spi.deployment.Endpoint with the code Okar gave you, you can do

                            EndpointMetrics epm = endpoint.getEndpointMetrics();
                            epm.getAverageProcessingTime();
                            epm.getRequestCount();
                            ...

                            This is another solution, with its own advantages and disadvantages. I still think it might be interesting to take a look at the jmx way.

                            • 11. Re: Deployed service statistics

                              Hi Alessio,
                              Let's see if I understand:

                              Could I write a web service method like this?

                              @WebMethod
                              public java.util.Date getStartDate(){
                               // get SPI provider and endpoint registry
                               SPIProvider spiProvider = SPIProviderResolver.getInstance()
                               .getProvider();
                               EndpointRegistry epRegistry = spiProvider.getSPI(
                               EndpointRegistryFactory.class).getEndpointRegistry();
                              
                               // loop over all endpoints
                               Set<ObjectName> objectNames = epRegistry.getEndpoints();
                               for (ObjectName objectName : objectNames) {
                              
                               // get the endpoint by using its name
                               Endpoint endpoint = epRegistry.getEndpoint(objectName);
                              
                              
                               EndpointMetrics epm = endpoint.getEndpointMetrics();
                               return epm.getStartTime();
                              }
                              



                              In this simple way?

                              Thanks, bye bye.

                              • 12. Re: Deployed service statistics
                                asoldano

                                Why don't you try? Yeah, you can, this should give you the start time of one (probably the first) of your deployed endpoint.

                                • 13. Re: Deployed service statistics

                                  Hi Alesso,thanks, now it works!
                                  Another question is it possible to get the statistics of each operation of each endpoint?
                                  Thanks, bye bye.

                                  • 14. Re: Deployed service statistics
                                    asoldano

                                     

                                    "abdujaparov" wrote:
                                    Hi Alesso,thanks, now it works!
                                    Another question is it possible to get the statistics of each operation of each endpoint?
                                    Thanks, bye bye.


                                    No, not right now. But, as I said, we are thinking of features like this in the productivity thread I mentioned above, feel free to suggest your ideas.
                                    http://www.jboss.com/index.html?module=bb&op=viewtopic&t=121473
                                    Thank you

                                    1 2 Previous Next