<commit_before>
# OpenTSDB

[OpenTSDB][website] is a distributed, scalable Time Series Database (TSDB) written on
top of HBase.  OpenTSDB was written to address a common need: store, index
and serve metrics collected from computer systems (network gear, operating
systems, applications) at a large scale, and make this data easily accessible
and graphable.
OpenTSDB does not seem to work without the hbase rights

    module.exports = []

## Configuration

    module.exports.configure = (ctx) ->
      {hbase} = (ctx.contexts 'ryba/hbase/regionserver', require('../hbase/regionserver').configure)[0].config.ryba
      opentsdb = ctx.config.ryba.opentsdb ?= {}
      # User
      opentsdb.user = name: opentsdb.user if typeof opentsdb.user is 'string'
      opentsdb.user ?= {}
      opentsdb.user.name ?= 'opentsdb'
      opentsdb.user.system ?= true
      opentsdb.user.comment ?= 'OpenTSDB User'
      opentsdb.user.home = '/usr/share/opentsdb'
      # Groups
      opentsdb.group = name: opentsdb.group if typeof opentsdb.group is 'string'
      opentsdb.group ?= {}
      opentsdb.group.name ?= 'opentsdb'
      opentsdb.group.system ?= true
      opentsdb.user.gid = opentsdb.group.name
      # Package
      opentsdb.version ?= "2.2.0"
      opentsdb.source ?= "https://github.com/OpenTSDB/opentsdb/releases/download/v#{opentsdb.version}/opentsdb-#{opentsdb.version}.noarch.rpm"
      # opentsdb.hbase
      opentsdb.hbase ?= {}
      opentsdb.hbase.bloomfilter ?= 'ROW'
      opentsdb.hbase.compression ?= 'SNAPPY'
      throw Error "Invalid opentsdb.hbase.bloomfilter '#{opentsdb.hbase.bloomfilter}' (NONE|ROW|ROWCOL)" unless opentsdb.hbase.bloomfilter in ['NONE', 'ROW', 'ROWCOL']
      throw Error "Invalid opentsdb.hbase.compression '#{opentsdb.hbase.compression}' (NONE|LZO|GZIP|SNAPPY)" unless opentsdb.hbase.compression in ['NONE', 'LZO', 'GZIP', 'SNAPPY']
      # Config
      opentsdb.config ?= {}
      opentsdb.config['tsd.http.staticroot'] ?= "#{opentsdb.user.home}/static/"
      opentsdb.config['tsd.http.cachedir'] ?= '/tmp/opentsdb'
      opentsdb.config['tsd.core.plugin_path'] ?= "#{opentsdb.user.home}/plugins"
      opentsdb.config['tsd.network.port'] ?= 4242
      # zookeeper...
      zoo_ctxs = ctx.contexts 'ryba/zookeeper/server'
      opentsdb.config['tsd.storage.hbase.zk_quorum'] ?= zoo_ctxs.map((ctx) -> "#{ctx.config.host}:#{ctx.config.ryba.zookeeper.port}").join ','
      opentsdb.config['tsd.storage.hbase.zk_basedir'] ?= hbase.site['zookeeper.znode.parent']
      opentsdb.config['tsd.storage.hbase.data_table'] ?= 'tsdb'
      opentsdb.config['tsd.storage.hbase.uid_table'] ?= 'tsdb-uid'
      opentsdb.config['tsd.storage.hbase.tree_table'] ?= 'tsdb-tree'
      opentsdb.config['tsd.storage.hbase.meta_table'] ?= 'tsdb-meta'
      opentsdb.config['hbase.security.authentication'] ?= hbase.site['hbase.security.authentication']
      if opentsdb.config['hbase.security.authentication'] is 'kerberos'
        opentsdb.config['hbase.security.auth.enable'] ?= 'true' 
        opentsdb.config['hbase.kerberos.regionserver.principal'] ?= hbase.site['hbase.regionserver.kerberos.principal']
        opentsdb.config['java.security.auth.login.config'] ?= '/etc/opentsdb/opentsdb.jaas'
        opentsdb.config['hbase.sasl.clientconfig'] ?= 'Client'
      # Env
      opentsdb.env ?= {}
      opentsdb.env['java.security.auth.login.config'] ?= opentsdb.config['java.security.auth.login.config']
      # Opts
      opentsdb.java_opts ?= ''

## Commands

    module.exports.push commands: 'check', modules: 'ryba/opentsdb/check'<commit_msg>opentsdb: add conf for grafana working by default<commit_after>
# OpenTSDB

[OpenTSDB][website] is a distributed, scalable Time Series Database (TSDB) written on
top of HBase.  OpenTSDB was written to address a common need: store, index
and serve metrics collected from computer systems (network gear, operating
systems, applications) at a large scale, and make this data easily accessible
and graphable.
OpenTSDB does not seem to work without the hbase rights

    module.exports = []

## Configuration

    module.exports.configure = (ctx) ->
      {hbase} = (ctx.contexts 'ryba/hbase/regionserver', require('../hbase/regionserver').configure)[0].config.ryba
      opentsdb = ctx.config.ryba.opentsdb ?= {}
      # User
      opentsdb.user = name: opentsdb.user if typeof opentsdb.user is 'string'
      opentsdb.user ?= {}
      opentsdb.user.name ?= 'opentsdb'
      opentsdb.user.system ?= true
      opentsdb.user.comment ?= 'OpenTSDB User'
      opentsdb.user.home = '/usr/share/opentsdb'
      # Groups
      opentsdb.group = name: opentsdb.group if typeof opentsdb.group is 'string'
      opentsdb.group ?= {}
      opentsdb.group.name ?= 'opentsdb'
      opentsdb.group.system ?= true
      opentsdb.user.gid = opentsdb.group.name
      # Package
      opentsdb.version ?= "2.2.0"
      opentsdb.source ?= "https://github.com/OpenTSDB/opentsdb/releases/download/v#{opentsdb.version}/opentsdb-#{opentsdb.version}.noarch.rpm"
      # opentsdb.hbase
      opentsdb.hbase ?= {}
      opentsdb.hbase.bloomfilter ?= 'ROW'
      opentsdb.hbase.compression ?= 'SNAPPY'
      throw Error "Invalid opentsdb.hbase.bloomfilter '#{opentsdb.hbase.bloomfilter}' (NONE|ROW|ROWCOL)" unless opentsdb.hbase.bloomfilter in ['NONE', 'ROW', 'ROWCOL']
      throw Error "Invalid opentsdb.hbase.compression '#{opentsdb.hbase.compression}' (NONE|LZO|GZIP|SNAPPY)" unless opentsdb.hbase.compression in ['NONE', 'LZO', 'GZIP', 'SNAPPY']
      # Config
      opentsdb.config ?= {}
      opentsdb.config['tsd.http.staticroot'] ?= "#{opentsdb.user.home}/static/"
      opentsdb.config['tsd.http.cachedir'] ?= '/tmp/opentsdb'
      opentsdb.config['tsd.core.plugin_path'] ?= "#{opentsdb.user.home}/plugins"
      opentsdb.config['tsd.core.meta.enable_realtime_ts'] ?= 'true'
      opentsdb.config['tsd.http.request.cors_domains'] ?= '*'
      opentsdb.config['tsd.network.port'] ?= 4242
      # zookeeper...
      zoo_ctxs = ctx.contexts 'ryba/zookeeper/server'
      opentsdb.config['tsd.storage.hbase.zk_quorum'] ?= zoo_ctxs.map((ctx) -> "#{ctx.config.host}:#{ctx.config.ryba.zookeeper.port}").join ','
      opentsdb.config['tsd.storage.hbase.zk_basedir'] ?= hbase.site['zookeeper.znode.parent']
      opentsdb.config['tsd.storage.hbase.data_table'] ?= 'tsdb'
      opentsdb.config['tsd.storage.hbase.uid_table'] ?= 'tsdb-uid'
      opentsdb.config['tsd.storage.hbase.tree_table'] ?= 'tsdb-tree'
      opentsdb.config['tsd.storage.hbase.meta_table'] ?= 'tsdb-meta'
      opentsdb.config['tsd.query.allow_simultaneous_duplicates'] ?= 'true'
      opentsdb.config['hbase.security.authentication'] ?= hbase.site['hbase.security.authentication']
      if opentsdb.config['hbase.security.authentication'] is 'kerberos'
        opentsdb.config['hbase.security.auth.enable'] ?= 'true' 
        opentsdb.config['hbase.kerberos.regionserver.principal'] ?= hbase.site['hbase.regionserver.kerberos.principal']
        opentsdb.config['java.security.auth.login.config'] ?= '/etc/opentsdb/opentsdb.jaas'
        opentsdb.config['hbase.sasl.clientconfig'] ?= 'Client'
      # Env
      opentsdb.env ?= {}
      opentsdb.env['java.security.auth.login.config'] ?= opentsdb.config['java.security.auth.login.config']
      # Opts
      opentsdb.java_opts ?= ''

## Commands

    module.exports.push commands: 'check', modules: 'ryba/opentsdb/check'
{'fraction_non_alphanumeric': 0.15291886766896925, 'fraction_numerical': 0.00216714072870107, 'mean_word_length': 3.620775969962453, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7523910', 'n_tokens_mistral': 2638, 'n_tokens_neox': 2602, 'n_words': 399}