Package org.jclouds.glesys.domain

Examples of org.jclouds.glesys.domain.ResourceUsage$ConcreteBuilder


            HttpResponse.builder().statusCode(200)
                  .payload(payloadFromResourceWithContentType("/server_resource_usage.json", MediaType.APPLICATION_JSON))
                  .build())
            .getServerApi();

      ResourceUsage expected = ResourceUsage.builder().info(
            ResourceUsageInfo.builder().resolution("minute").resource("diskioread").unit("KB").build())
            .values(
                  ResourceUsageValue.builder().value(0.0).timestamp(dateService.iso8601SecondsDateParse("2012-06-24T14:21:07+02:00")).build(),
                  ResourceUsageValue.builder().value(5.1).timestamp(dateService.iso8601SecondsDateParse("2012-06-24T14:22:05+02:00")).build(),
                  ResourceUsageValue.builder().value(0.0).timestamp(dateService.iso8601SecondsDateParse("2012-06-24T14:23:05+02:00")).build(),
                  ResourceUsageValue.builder().value(10.0).timestamp(dateService.iso8601SecondsDateParse("2012-06-24T14:24:08+02:00")).build(),
                  ResourceUsageValue.builder().value(0.0).timestamp(dateService.iso8601SecondsDateParse("2012-06-24T14:25:12+02:00")).build(),
                  ResourceUsageValue.builder().value(0.0).timestamp(dateService.iso8601SecondsDateParse("2012-06-24T14:26:07+02:00")).build(),
                  ResourceUsageValue.builder().value(0.0).timestamp(dateService.iso8601SecondsDateParse("2012-06-24T14:27:12+02:00")).build(),
                  ResourceUsageValue.builder().value(0.0).timestamp(dateService.iso8601SecondsDateParse("2012-06-24T14:28:05+02:00")).build()
            ).build();
      assertEquals(api.getResourceUsage("server777", "diskioread", "minute").toString(), expected.toString());
   }
View Full Code Here


   public void testResourceUsage() throws Exception {
      // test server has only been in existence for less than a minute - check all servers
      for (Server server : serverApi.list()) {
         try {
            ResourceUsage usage = serverApi.getResourceUsage(server.getId(), "diskioread", "minute");
            assertEquals(usage.getInfo().getResource(), "diskioread");
            assertEquals(usage.getInfo().getResolution(), "minute");
         } catch (UnsupportedOperationException e) {

         }
         try {
            ResourceUsage usage = serverApi.getResourceUsage(server.getId(), "cpuusage", "minute");
            assertEquals(usage.getInfo().getResource(), "cpuusage");
            assertEquals(usage.getInfo().getResolution(), "minute");
         } catch (UnsupportedOperationException e) {

         }
      }
   }
View Full Code Here

            HttpResponse.builder().statusCode(200)
                  .payload(payloadFromResourceWithContentType("/server_resource_usage.json", MediaType.APPLICATION_JSON))
                  .build())
            .getServerApi();

      ResourceUsage expected = ResourceUsage.builder().info(
            ResourceUsageInfo.builder().resolution("minute").resource("diskioread").unit("KB").build())
            .values(
                  ResourceUsageValue.builder().value(0.0).timestamp(dateService.iso8601SecondsDateParse("2012-06-24T14:21:07+02:00")).build(),
                  ResourceUsageValue.builder().value(5.1).timestamp(dateService.iso8601SecondsDateParse("2012-06-24T14:22:05+02:00")).build(),
                  ResourceUsageValue.builder().value(0.0).timestamp(dateService.iso8601SecondsDateParse("2012-06-24T14:23:05+02:00")).build(),
                  ResourceUsageValue.builder().value(10.0).timestamp(dateService.iso8601SecondsDateParse("2012-06-24T14:24:08+02:00")).build(),
                  ResourceUsageValue.builder().value(0.0).timestamp(dateService.iso8601SecondsDateParse("2012-06-24T14:25:12+02:00")).build(),
                  ResourceUsageValue.builder().value(0.0).timestamp(dateService.iso8601SecondsDateParse("2012-06-24T14:26:07+02:00")).build(),
                  ResourceUsageValue.builder().value(0.0).timestamp(dateService.iso8601SecondsDateParse("2012-06-24T14:27:12+02:00")).build(),
                  ResourceUsageValue.builder().value(0.0).timestamp(dateService.iso8601SecondsDateParse("2012-06-24T14:28:05+02:00")).build()
            ).build();
      assertEquals(api.getResourceUsage("server777", "diskioread", "minute").toString(), expected.toString());
   }
View Full Code Here

   public void testResourceUsage() throws Exception {
      // test server has only been in existence for less than a minute - check all servers
      for (Server server : serverApi.list()) {
         try {
            ResourceUsage usage = serverApi.getResourceUsage(server.getId(), "diskioread", "minute");
            assertEquals(usage.getInfo().getResource(), "diskioread");
            assertEquals(usage.getInfo().getResolution(), "minute");
         } catch (UnsupportedOperationException e) {

         }
         try {
            ResourceUsage usage = serverApi.getResourceUsage(server.getId(), "cpuusage", "minute");
            assertEquals(usage.getInfo().getResource(), "cpuusage");
            assertEquals(usage.getInfo().getResolution(), "minute");
         } catch (UnsupportedOperationException e) {

         }
      }
   }
View Full Code Here

   public void testResourceUsage() throws Exception {
      // test server has only been in existence for less than a minute - check all servers
      for (Server server : serverApi.list()) {
         try {
            ResourceUsage usage = serverApi.getResourceUsage(server.getId(), "diskioread", "minute");
            assertEquals(usage.getInfo().getResource(), "diskioread");
            assertEquals(usage.getInfo().getResolution(), "minute");
         } catch (UnsupportedOperationException e) {

         }
         try {
            ResourceUsage usage = serverApi.getResourceUsage(server.getId(), "cpuusage", "minute");
            assertEquals(usage.getInfo().getResource(), "cpuusage");
            assertEquals(usage.getInfo().getResolution(), "minute");
         } catch (UnsupportedOperationException e) {

         }
      }
   }
View Full Code Here

            HttpResponse.builder().statusCode(200)
                  .payload(payloadFromResourceWithContentType("/server_resource_usage.json", MediaType.APPLICATION_JSON))
                  .build())
            .getServerApi();

      ResourceUsage expected = ResourceUsage.builder().info(
            ResourceUsageInfo.builder().resolution("minute").resource("diskioread").unit("KB").build())
            .values(
                  ResourceUsageValue.builder().value(0.0).timestamp(dateService.iso8601SecondsDateParse("2012-06-24T14:21:07+02:00")).build(),
                  ResourceUsageValue.builder().value(5.1).timestamp(dateService.iso8601SecondsDateParse("2012-06-24T14:22:05+02:00")).build(),
                  ResourceUsageValue.builder().value(0.0).timestamp(dateService.iso8601SecondsDateParse("2012-06-24T14:23:05+02:00")).build(),
                  ResourceUsageValue.builder().value(10.0).timestamp(dateService.iso8601SecondsDateParse("2012-06-24T14:24:08+02:00")).build(),
                  ResourceUsageValue.builder().value(0.0).timestamp(dateService.iso8601SecondsDateParse("2012-06-24T14:25:12+02:00")).build(),
                  ResourceUsageValue.builder().value(0.0).timestamp(dateService.iso8601SecondsDateParse("2012-06-24T14:26:07+02:00")).build(),
                  ResourceUsageValue.builder().value(0.0).timestamp(dateService.iso8601SecondsDateParse("2012-06-24T14:27:12+02:00")).build(),
                  ResourceUsageValue.builder().value(0.0).timestamp(dateService.iso8601SecondsDateParse("2012-06-24T14:28:05+02:00")).build()
            ).build();
      assertEquals(api.getResourceUsage("server777", "diskioread", "minute").toString(), expected.toString());
   }
View Full Code Here

   public void testResourceUsage() throws Exception {
      // test server has only been in existence for less than a minute - check all servers
      for (Server server : serverApi.list()) {
         try {
            ResourceUsage usage = serverApi.getResourceUsage(server.getId(), "diskioread", "minute");
            assertEquals(usage.getInfo().getResource(), "diskioread");
            assertEquals(usage.getInfo().getResolution(), "minute");
         } catch (UnsupportedOperationException e) {

         }
         try {
            ResourceUsage usage = serverApi.getResourceUsage(server.getId(), "cpuusage", "minute");
            assertEquals(usage.getInfo().getResource(), "cpuusage");
            assertEquals(usage.getInfo().getResolution(), "minute");
         } catch (UnsupportedOperationException e) {

         }
      }
   }
View Full Code Here

   public void testResourceUsage() throws Exception {
      // test server has only been in existence for less than a minute - check all servers
      for (Server server : serverApi.list()) {
         try {
            ResourceUsage usage = serverApi.getResourceUsage(server.getId(), "diskioread", "minute");
            assertEquals(usage.getInfo().getResource(), "diskioread");
            assertEquals(usage.getInfo().getResolution(), "minute");
         } catch (UnsupportedOperationException e) {

         }
         try {
            ResourceUsage usage = serverApi.getResourceUsage(server.getId(), "cpuusage", "minute");
            assertEquals(usage.getInfo().getResource(), "cpuusage");
            assertEquals(usage.getInfo().getResolution(), "minute");
         } catch (UnsupportedOperationException e) {

         }
      }
   }
View Full Code Here

            HttpResponse.builder().statusCode(200)
                  .payload(payloadFromResourceWithContentType("/server_resource_usage.json", MediaType.APPLICATION_JSON))
                  .build())
            .getServerApi();

      ResourceUsage expected = ResourceUsage.builder().info(
            ResourceUsageInfo.builder().resolution("minute").resource("diskioread").unit("KB").build())
            .values(
                  ResourceUsageValue.builder().value(0.0).timestamp(dateService.iso8601SecondsDateParse("2012-06-24T14:21:07+02:00")).build(),
                  ResourceUsageValue.builder().value(5.1).timestamp(dateService.iso8601SecondsDateParse("2012-06-24T14:22:05+02:00")).build(),
                  ResourceUsageValue.builder().value(0.0).timestamp(dateService.iso8601SecondsDateParse("2012-06-24T14:23:05+02:00")).build(),
                  ResourceUsageValue.builder().value(10.0).timestamp(dateService.iso8601SecondsDateParse("2012-06-24T14:24:08+02:00")).build(),
                  ResourceUsageValue.builder().value(0.0).timestamp(dateService.iso8601SecondsDateParse("2012-06-24T14:25:12+02:00")).build(),
                  ResourceUsageValue.builder().value(0.0).timestamp(dateService.iso8601SecondsDateParse("2012-06-24T14:26:07+02:00")).build(),
                  ResourceUsageValue.builder().value(0.0).timestamp(dateService.iso8601SecondsDateParse("2012-06-24T14:27:12+02:00")).build(),
                  ResourceUsageValue.builder().value(0.0).timestamp(dateService.iso8601SecondsDateParse("2012-06-24T14:28:05+02:00")).build()
            ).build();
      assertEquals(api.getResourceUsage("server777", "diskioread", "minute").toString(), expected.toString());
   }
View Full Code Here

TOP

Related Classes of org.jclouds.glesys.domain.ResourceUsage$ConcreteBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.