def setMetadata(self, metric, key, value): node = self.tree.getNode(TaggedSeries.encode(metric)) metadata = node.readMetadata() metadata[key] = value node.writeMetadata(metadata)
def getFilesystemPath(self, metric): return self.tree.getFilesystemPath(TaggedSeries.encode(metric))
def create(self, metric, retentions, xfilesfactor, aggregation_method): self.tree.createNode(TaggedSeries.encode(metric), retentions=retentions, timeStep=retentions[0][0], xFilesFactor=xfilesfactor, aggregationMethod=aggregation_method)
def getMetadata(self, metric, key): return self.tree.getNode( TaggedSeries.encode(metric)).readMetadata()[key]
def write(self, metric, datapoints): self.tree.store(TaggedSeries.encode(metric), datapoints)
def exists(self, metric): return self.tree.hasNode(TaggedSeries.encode(metric))
def getFilesystemPath(self, metric): return join(self.data_dir, TaggedSeries.encode(metric, sep) + '.wsp')
def encode(self, metric, tag_hash_filenames=None): if tag_hash_filenames is None: tag_hash_filenames = self.tag_hash_filenames return TaggedSeries.encode(metric, hash_only=tag_hash_filenames)
def _getFilesystemPath(self, metric, tag_hash_filenames): return join( self.data_dir, TaggedSeries.encode(metric, sep, hash_only=tag_hash_filenames) + '.wsp' )
def encode(self, metric, tag_hash_filenames=None): if tag_hash_filenames is None: tag_hash_filenames = self.tag_hash_filenames return TaggedSeries.encode(metric, hash_only=tag_hash_filenames)
def _getFilesystemPath(self, metric, tag_hash_filenames): return join( self.data_dir, TaggedSeries.encode(metric, sep, hash_only=tag_hash_filenames) + '.wsp')