if (resourceType.getStatisticDescriptors().length >= ILLEGAL_STAT_OFFSET) { throw new InternalGemFireException( String.format("Could not archive type %s because it had more than %s statistics.", new Object[] {resourceType.getStatisticsType().getName(), Integer.valueOf(ILLEGAL_STAT_OFFSET - 1)})); this.dataOut.writeInt(resourceType.getId()); this.dataOut.writeUTF(resourceType.getStatisticsType().getName()); this.dataOut.writeUTF(resourceType.getStatisticsType().getDescription()); StatisticDescriptor[] stats = resourceType.getStatisticDescriptors(); this.dataOut.writeShort(stats.length); if (this.trace && (traceStatisticsTypeName == null || traceStatisticsTypeName.equals(resourceType.getStatisticsType().getName()))) { this.traceDataOut .println("allocatedResourceType#writeByte RESOURCE_TYPE_TOKEN: " + RESOURCE_TYPE_TOKEN); this.traceDataOut.println( "allocatedResourceType#writeInt resourceType.getId(): " + resourceType.getId()); this.traceDataOut .println("allocatedResourceType#writeUTF resourceType.getStatisticsType().getName(): " + resourceType.getStatisticsType().getName()); this.traceDataOut.println( "allocatedResourceType#writeUTF resourceType.getStatisticsType().getDescription(): " + resourceType.getStatisticsType().getDescription()); this.traceDataOut.println("allocatedResourceType#writeShort stats.length: " + stats.length); this.dataOut.writeUTF(stats[i].getDescription()); if (this.trace && (traceStatisticsTypeName == null || traceStatisticsTypeName.equals(resourceType.getStatisticsType().getName()))) { this.traceDataOut
private ResourceType allocateResourceType(List<MarkableSampleHandler> handlers, StatisticsType type) throws IgnoreResourceException { if (logger.isTraceEnabled(LogMarker.STATISTICS_VERBOSE)) { logger.trace(LogMarker.STATISTICS_VERBOSE, "SampleCollector#allocateResourceType type={}", type); } ResourceType resourceType = new ResourceType(this.resourceTypeId, type); this.resourceTypeMap.put(type, resourceType); this.resourceTypeId++; return resourceType; }
|| traceStatisticsName.equals(ri.getStatistics().getTextId())) && (traceStatisticsTypeName == null || traceStatisticsTypeName .equals(ri.getResourceType().getStatisticsType().getName()))) { this.traceDataOut.println("writeSample#writeSample for ri=" + ri); return; StatisticDescriptor[] stats = ri.getResourceType().getStatisticDescriptors(); if (stats.length > 254) { throw new Error("StatisticsType " + ri.getResourceType().getStatisticsType().getName() + " has too many stats: " + stats.length); || traceStatisticsName.equals(ri.getStatistics().getTextId())) && (traceStatisticsTypeName == null || traceStatisticsTypeName .equals(ri.getResourceType().getStatisticsType().getName()))) { this.traceDataOut.println("writeSample#writeByte i: " + i); || traceStatisticsName.equals(ri.getStatistics().getTextId())) && (traceStatisticsTypeName == null || traceStatisticsTypeName .equals(ri.getResourceType().getStatisticsType().getName()))) { byte typeCode = ((StatisticDescriptorImpl) stats[i]).getTypeCode(); switch (typeCode) { || traceStatisticsName.equals(ri.getStatistics().getTextId())) && (traceStatisticsTypeName == null || traceStatisticsTypeName .equals(ri.getResourceType().getStatisticsType().getName()))) { this.traceDataOut .println("writeSample#writeByte ILLEGAL_STAT_OFFSET: " + ILLEGAL_STAT_OFFSET);
protected void monitorStatistics(final long millisTimeStamp, final List<ResourceInstance> resourceInstances) { if (!this.statistics.isEmpty()) { Map<StatisticId, Number> stats = new HashMap<>(); for (ResourceInstance resource : resourceInstances) { if (this.statistics.contains(resource.getStatistics())) { ResourceType resourceType = resource.getResourceType(); StatisticDescriptor[] sds = resourceType.getStatisticDescriptors(); int[] updatedStats = resource.getUpdatedStats(); for (int i = 0; i < updatedStats.length; i++) { int idx = updatedStats[i]; StatisticDescriptorImpl sdi = (StatisticDescriptorImpl) sds[idx]; SimpleStatisticId statId = new SimpleStatisticId(sdi, resource.getStatistics()); long rawbits = resource.getLatestStatValues()[idx]; stats.put(statId, sdi.getNumberForRawBits(rawbits)); } } } if (!stats.isEmpty()) { MapBasedStatisticsNotification notification = new MapBasedStatisticsNotification( millisTimeStamp, StatisticsNotification.Type.VALUE_CHANGED, stats); notifyListeners(notification); } } }
|| traceStatisticsName.equals(resourceInstance.getStatistics().getTextId())) && (traceStatisticsTypeName == null || traceStatisticsTypeName .equals(resourceInstance.getResourceType().getStatisticsType().getName()))) { this.traceDataOut .println("destroyedResourceInstance#writeByte RESOURCE_INSTANCE_DELETE_TOKEN: "
StatisticDescriptor[] stats = ri.getResourceType().getStatisticDescriptors(); if (ri.getStatistics().isClosed()) { continue;
"StatArchiveWriter#allocatedResourceInstance statResource={}", statResource); if (statResource.getResourceType().getStatisticDescriptors().length >= ILLEGAL_STAT_OFFSET) { throw new InternalGemFireException( String.format("Could not archive type %s because it had more than %s statistics.", new Object[] {statResource.getResourceType().getStatisticsType().getName(), Integer.valueOf(ILLEGAL_STAT_OFFSET - 1)})); this.dataOut.writeUTF(statResource.getStatistics().getTextId()); this.dataOut.writeLong(statResource.getStatistics().getNumericId()); this.dataOut.writeInt(statResource.getResourceType().getId()); if (this.trace && (traceStatisticsName == null || traceStatisticsName.equals(statResource.getStatistics().getTextId())) && (traceStatisticsTypeName == null || traceStatisticsTypeName .equals(statResource.getResourceType().getStatisticsType().getName()))) { traceResourceInstId = statResource.getId(); this.traceDataOut.println("writeHeader traceResourceInstId: " + traceResourceInstId); this.traceDataOut .println("allocatedResourceInstance#writeInt statResource.getResourceType().getId(): " + statResource.getResourceType().getId());
ResourceType resourceType = allocatedResourceTypeInfo.getResourceType(); assertNotNull(resourceType); assertEquals(0, resourceType.getId()); assertEquals(1, resourceType.getStatisticDescriptors().length); StatisticsType statisticsType = resourceType.getStatisticsType(); assertNotNull(statisticsType); assertTrue(statisticsType == ST1);
ResourceType resourceType = allocatedResourceTypeInfo.getResourceType(); assertNotNull(resourceType); assertEquals(0, resourceType.getId()); assertEquals(1, resourceType.getStatisticDescriptors().length); StatisticsType statisticsType = resourceType.getStatisticsType(); assertNotNull(statisticsType); assertTrue(statisticsType == ST1); resourceType = allocatedResourceTypeInfo.getResourceType(); assertNotNull(resourceType); assertEquals(1, resourceType.getId()); assertEquals(1, resourceType.getStatisticDescriptors().length); statisticsType = resourceType.getStatisticsType(); assertNotNull(statisticsType); assertTrue(statisticsType == ST2);