You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jclouds.apache.org by George Kousiouris <gk...@mail.ntua.gr> on 2015/04/02 16:25:57 UTC

Re: Timing of provider API response

hi,
many thanks for the reply. I am interested in measuring the provider api 
response (priority is in Amazon, nice to have extension would be Google 
compute).

I see in the EC2ListNodesStrategy class this part:
  public Set<? extends ComputeMetadata> listNodes() {
       return listDetailsOnNodesMatching(NodePredicates.all());
    }

probably it gets all right? this would seem reasonable since the calls 
are measured to take  ~20 seconds

On 4/1/2015 12:01 AM, Ignasi Barrera wrote:
> The listNodes method can do more than one call, depending on the 
> provider. Some providers just return partial data when listing, some 
> return the entire node data. In the former, jclouds will perform a get 
> operation on each returned node to return a list of fully populated 
> objects, so the metrics could be biased depending on the provider.
>
> Are you trying to measure how much it takes to jclouds to get the list 
> of nodes or are you trying to measure how fast the provider api 
> responds? You can do the latter by configuring an interceptor at the 
> http driver level.
>
> On 31 March 2015 at 20:07, George Kousiouris <gkousiou@mail.ntua.gr 
> <ma...@mail.ntua.gr>> wrote:
>
>
>     Hi all,
>
>     I want to check out the response time of provider APIs to a
>     request for retrieving the server list. I use the following piece
>     of code to get it and afterwards in order to search in the
>     metadata e.g.
>
>     ComputeServiceContext context = ContextBuilder.newBuilder(provider)
>                     .credentials(user, apiKey)
>
>                     .buildView(ComputeServiceContext.class);
>
>             ComputeService computeService = context.getComputeService();
>
>     *//checkpoint 1**---startTime*
>     Set<? extends ComputeMetadata> localCS=computeService.listNodes();
>     *//checkpoint2---EndTime*
>      context.close();
>
>     List<? extends ComputeMetadata> NodeList = new ArrayList(localCS);
>     for (ComputeMetadata node : localCS) {
>         node.getName();
>          NodeMetadata metadata =
>     computeService.getNodeMetadata(node.getId());
>
>
>     Are the check points included valid? From what i understand the
>     initial lines before checkpoint1 are just for preparation, while
>     the actual call is made in the computeService.listNodes() line.
>     And afterwards (after checkpoint2) the metadata in e.g.
>     computeService.getNodeMetadata(node.getId()) are taken from the
>     local response, right?
>
>     Cheers,
>     George
>
>     -- 
>     ---------------------------
>
>
>
>     ------------------------------------------------------------------------
>     <http://www.avast.com/> 	
>
>     This email is free from viruses and malware because avast!
>     Antivirus <http://www.avast.com/> protection is active.
>
>
>




---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com

Re: Timing of provider API response

Posted by Ignasi Barrera <na...@apache.org>.
Yes, that call will get all the nodes, but as I said, it depends on the
provider. Some may only need one fast call to the target API to get all the
info, others may need to perform N calls to get all the required info. AWS
needs to make several calls to be able to populate all the information in
the returned nodes, and that's why it takes that time.

On 2 April 2015 at 16:25, George Kousiouris <gk...@mail.ntua.gr> wrote:

>
> hi,
> many thanks for the reply. I am interested in measuring the provider api
> response (priority is in Amazon, nice to have extension would be Google
> compute).
>
> I see in the EC2ListNodesStrategy class this part:
>  public Set<? extends ComputeMetadata> listNodes() {
>       return listDetailsOnNodesMatching(NodePredicates.all());
>    }
>
> probably it gets all right? this would seem reasonable since the calls are
> measured to take  ~20 seconds
>
>
> On 4/1/2015 12:01 AM, Ignasi Barrera wrote:
>
> The listNodes method can do more than one call, depending on the provider.
> Some providers just return partial data when listing, some return the
> entire node data. In the former, jclouds will perform a get operation on
> each returned node to return a list of fully populated objects, so the
> metrics could be biased depending on the provider.
>
>  Are you trying to measure how much it takes to jclouds to get the list
> of nodes or are you trying to measure how fast the provider api responds?
> You can do the latter by configuring an interceptor at the http driver
> level.
>
> On 31 March 2015 at 20:07, George Kousiouris <gk...@mail.ntua.gr>
> wrote:
>
>>
>> Hi all,
>>
>> I want to check out the response time of provider APIs to a request for
>> retrieving the server list. I use the following piece of code to get it and
>> afterwards in order to search in the metadata e.g.
>>
>> ComputeServiceContext context = ContextBuilder.newBuilder(provider)
>>                 .credentials(user, apiKey)
>>
>>                 .buildView(ComputeServiceContext.class);
>>
>>         ComputeService computeService = context.getComputeService();
>>
>> *//checkpoint 1**---startTime*
>> Set<? extends ComputeMetadata> localCS=computeService.listNodes();
>> *//checkpoint2---EndTime*
>>  context.close();
>>
>> List<? extends ComputeMetadata> NodeList = new ArrayList(localCS);
>> for (ComputeMetadata node : localCS) {
>>     node.getName();
>>      NodeMetadata metadata = computeService.getNodeMetadata(node.getId());
>>
>>
>> Are the check points included valid? From what i understand the initial
>> lines before checkpoint1 are just for preparation, while the actual call is
>> made in the computeService.listNodes() line. And afterwards (after
>> checkpoint2) the metadata in e.g.
>> computeService.getNodeMetadata(node.getId()) are taken from the local
>> response, right?
>>
>> Cheers,
>> George
>>
>> --
>> ---------------------------
>>
>>
>>
>>
>> ------------------------------
>>     <http://www.avast.com/>
>>
>> This email is free from viruses and malware because avast! Antivirus
>> <http://www.avast.com/> protection is active.
>>
>>
>
>
>
>
> ------------------------------
>    <http://www.avast.com/>
>
> This email is free from viruses and malware because avast! Antivirus
> <http://www.avast.com/> protection is active.
>
>