'Test to validate that cluster metrics names can\'t overlap.
@since 3.6.0
@jira_ticket PYTHON-561
@expected_result metric names should not be allowed to be same.
@test_category metrics'

def test_duplicate_metrics_per_cluster(self):

    cluster2 = Cluster(metrics_enabled=True, protocol_version=PROTOCOL_VERSION, default_retry_policy=FallthroughRetryPolicy())
    cluster3 = Cluster(metrics_enabled=True, protocol_version=PROTOCOL_VERSION, default_retry_policy=FallthroughRetryPolicy())
    cluster2.metrics.set_stats_name('appcluster')
    cluster2.metrics.set_stats_name('appcluster')
    with self.assertRaises(ValueError):
        cluster3.metrics.set_stats_name('appcluster')
    cluster3.metrics.set_stats_name('devops')
    session2 = cluster2.connect(self.ks_name, wait_for_all_pools=True)
    session3 = cluster3.connect(self.ks_name, wait_for_all_pools=True)
    for i in range(10):
        query = SimpleStatement('SELECT    *    FROM    {0}.{0}'.format(self.ks_name), consistency_level=ConsistencyLevel.ALL)
        session2.execute(query)
    for i in range(5):
        query = SimpleStatement('SELECT    *    FROM    {0}.{0}'.format(self.ks_name), consistency_level=ConsistencyLevel.ALL)
        session3.execute(query)
    self.assertEqual(cluster2.metrics.get_stats()['request_timer']['count'], 10)
    self.assertEqual(cluster3.metrics.get_stats()['request_timer']['count'], 5)
    self.assertTrue(('appcluster' in scales._Stats.stats.keys()))
    self.assertTrue(('devops' in scales._Stats.stats.keys()))
    cluster2.shutdown()
    cluster3.shutdown()
