Ejemplo n.º 1
0
 def test_index_pattern_use_prefix(self):
     index = check_elasticsearch_metrics.build_indices(indices_count=1, index_pattern="pattern-{prefix}", index_prefix="xxx")
     index.should.be.equal("pattern-xxx")
Ejemplo n.º 2
0
 def test_index_pattern_constant(self):
     index = check_elasticsearch_metrics.build_indices(indices_count=1, index_pattern="const", index_prefix="xxx")
     index.should.be.equal("const")
Ejemplo n.º 3
0
    def test_indices_count_gt_1(self):
        index = check_elasticsearch_metrics.build_indices(indices_count=2)
        index.should.be.equal("logstash-2018.01.15,logstash-2018.01.14")

        index = check_elasticsearch_metrics.build_indices(indices_count=3)
        index.should.be.equal("logstash-2018.01.15,logstash-2018.01.14,logstash-2018.01.13")
Ejemplo n.º 4
0
 def test_indices_count_eq_1(self):
     index = check_elasticsearch_metrics.build_indices(indices_count=1)
     index.should.be.equal("logstash-2018.01.15")
Ejemplo n.º 5
0
    def test_defaults(self, mock_datetime):
        index = check_elasticsearch_metrics.build_indices()

        index.should.be.equal("logstash-2018.01.15,logstash-2018.01.14")
Ejemplo n.º 6
0
    def test_base_case_positive(self, mock_datetime):
        index = check_elasticsearch_metrics.build_indices(indices_count=2, index_pattern="{prefix}-{yyyy}.{mm}.{dd}", index_prefix="logstash")

        index.should.be.equal("logstash-2018.01.15,logstash-2018.01.14")