Examples of DataPoint


Examples of org.jclouds.cloudwatch.domain.Datapoint

   DateService dateService = new SimpleDateFormatDateService();

   public Set<Datapoint> expected() {

      Set<Datapoint> expected = ImmutableSet.of(new Datapoint(0.17777777777777778, null, null, dateService
               .iso8601SecondsDateParse("2009-01-16T00:00:00Z"), 9.0, null, Unit.PERCENT, null), new Datapoint(0.1,
               null, null, dateService.iso8601SecondsDateParse("2009-01-16T00:01:00Z"), 8.0, null, Unit.PERCENT, null));
      return expected;
   }
View Full Code Here

Examples of org.junit.experimental.theories.DataPoint

                        "unexpected: argument length is checked");
            } catch (IllegalAccessException e) {
                throw new RuntimeException(
                        "unexpected: getMethods returned an inaccessible method");
            } catch (Throwable throwable) {
                DataPoint annotation = method.getAnnotation(DataPoint.class);
                Assume.assumeTrue(annotation == null || !isAssignableToAnyOf(annotation.ignoredExceptions(), throwable));
               
                throw new CouldNotGenerateValueException(throwable);
            }
        }
View Full Code Here

Examples of org.kairosdb.client.builder.DataPoint

      JsonArray array = (JsonArray) json.getAsJsonObject().get("values");
      for (JsonElement element : array)
      {
        JsonArray pair = element.getAsJsonArray();
        dataPoints.add(new DataPoint(pair.get(0).getAsLong(), context.<DataPoint>deserialize(pair.get(1), dataPointValueClass)));
      }
    }

    return new Results(name, tags, dataPoints, groupResults);
  }
View Full Code Here

Examples of org.lightfish.business.servermonitoring.control.collectors.DataPoint

    }

    @Test
    public void action_all_good() throws Exception {
        DataCollector collector = mock(DataCollector.class);
        DataPoint expectedResult = mock(DataPoint.class);
        when(collector.collect()).thenReturn(expectedResult);
        Future compute = action.compute(collector);
        assertEquals(expectedResult, compute.get());
    }
View Full Code Here

Examples of org.lightfish.business.servermonitoring.control.collectors.DataPoint

    }

    @Test
    public void action_with_retry() throws Exception {
        DataCollector collector = mock(DataCollector.class);
        DataPoint expectedResult = mock(DataPoint.class);
        when(collector.collect())
                .thenThrow(new Exception("Ahh!!"))
                .thenReturn(expectedResult);
        Future compute = action.compute(collector);
        assertEquals(expectedResult, compute.get());
View Full Code Here

Examples of org.lightfish.business.servermonitoring.control.collectors.DataPoint

    private Snapshot serialDataCollection(String instanceName) throws Exception {
        Snapshot snapshot = new Snapshot.Builder().build();
        DataCollectionBehaviour dataCollectionBehaviour = new DataCollectionBehaviour(mapper, snapshot);
        for (DataCollector collector : retrieveDataCollectorList(instanceName)) {
            DataPoint dataPoint = serialDataCollect(collector, 0);
            dataCollectionBehaviour.perform(dataPoint);
        }
        return snapshot;
    }
View Full Code Here

Examples of org.openhab.binding.em.internal.EMBindingConfig.Datapoint

      throws BindingConfigParseException {
    super.processBindingConfiguration(context, item, bindingConfig);
    String[] parts = bindingConfig.split(";");
    String address = null;
    EMType type = null;
    Datapoint datapoint = null;
    double correctionFactor = 0;
    for (String part : parts) {
      String[] keyValue = part.split("=");
      if ("type".equals(keyValue[0])) {
        type = EMType.getFromTypeValue(keyValue[1]);
View Full Code Here

Examples of org.openhab.binding.fht.FHTBindingConfig.Datapoint

    super.processBindingConfiguration(context, item, bindingConfig);
    String[] configParts = bindingConfig.split(";");

    String housecode = null;
    String address = null;
    Datapoint datapoint = null;
    for (String s : configParts) {
      String[] entryParts = s.split("=");
      if ("housecode".equals(entryParts[0])) {
        housecode = entryParts[1];
      } else if ("address".equals(entryParts[0])) {
View Full Code Here

Examples of org.rhq.modules.integrationTests.restApi.d.Datapoint

    @Test
    public void testPostGetRawData2() throws Exception {

        long now = System.currentTimeMillis();

        Datapoint dataPoint = new Datapoint();
        dataPoint.setMetric(scheduleName);
        dataPoint.setTimestamp(now);
        dataPoint.setValue(1.5);
        List<Datapoint> points = new ArrayList<Datapoint>(1);
        points.add(dataPoint);

        given()
            .header(acceptJson)
View Full Code Here

Examples of tcg.scada.da.DataPoint

    CosDpValueStruct value = new CosDpValueStruct();
    value.timestamp = 0;
    value.quality = CosDpQualityEnum.QualityGood;

    // update the value
    DataPoint dp = null;
    // int dpWordAddress = 0;
    boolean boolValue = false;
    long intValue = 0;
    String strValue = "";
    double dblValue = 0;
    for (int i = 0; i < datapoints.size(); i++)
    {
      dp = datapoints.get(i);
      if (dp == null)
      {
        continue;
      }

      switch (dp.getSourceType())
      {
        case TYPE_DI:
          boolValue = BufferParser.getBooleanValue(values, dp
              .getAddress()
              - offset, dp.getBitAddress());
          value.value.boolValue(boolValue);
          break;
        case TYPE_INT16:
          intValue = BufferParser.getLongValue(values, dp
              .getAddress()
              - offset, 2, false);
          value.value.longValue((int) intValue);
          break;
        case TYPE_INT32:
          intValue = BufferParser.getLongValue(values, dp
              .getAddress()
              - offset, 4, false);
          value.value.longValue((int) intValue);
          break;
        case TYPE_UINT16:
          intValue = BufferParser.getLongValue(values, dp
              .getAddress()
              - offset, 2, true);
          value.value.unsignedValue((int) intValue);
          break;
        case TYPE_UINT32:
          intValue = BufferParser.getLongValue(values, dp
              .getAddress()
              - offset, 4, true);
          value.value.unsignedValue((int) intValue);
          break;
        case TYPE_BCD:
          intValue = BufferParser.getBcdValue(values, dp.getAddress()
              - offset, dp.getLength() / 2);
          value.value.longValue((int) intValue);
          break;
        case TYPE_IEEE16:
          dblValue = BufferParser.getDoubleValue(values, dp
              .getAddress()
              - offset, 2);
          value.value.dblValue(dblValue);
          break;
        case TYPE_IEEE32:
          dblValue = BufferParser.getDoubleValue(values, dp
              .getAddress()
              - offset, 4);
          value.value.dblValue(dblValue);
          break;
        case TYPE_STRING:
          strValue = BufferParser.getStringValue(values, dp
              .getAddress()
              - offset, dp.getLength() / 2);
          value.value.charValue(strValue);
          break;
      }

      // set the dp value
      if (dp.setSourceValue(value) < 0)
      {
        logger.warn("Can not update source value of datapoint "
            + dp.name);
      }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.