8000 Keep only Dropwizard Metrics stats implementation · aashish13/rabbitmq-java-client@3ef53f7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3ef53f7

Browse files
committed
Keep only Dropwizard Metrics stats implementation
Fixes rabbitmq#79
1 parent 6a3d48f commit 3ef53f7

18 files changed

+453
-757
lines changed

src/main/java/com/rabbitmq/client/Connection.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,25 @@ public interface Connection extends ShutdownNotifier, Closeable { // rename to A
258258
*/
259259
ExceptionHandler getExceptionHandler();
260260

261+
/**
262+
* Unique ID for this connection.
263+
* This ID should be unique, otherwise some services
264+
* like the statistics collector won't work properly.
265+
* This ID doesn't have to be provided by the client,
266+
* services that require it will assign it automatically
267+
* if it's not set.
268+
* @return
269+
*/
261270
String getId();
262271

272+
/**
273+
* Set the unique ID for this connection.
274+
* This ID should be unique, otherwise some services
275+
* like the statistics collector won't work properly.
276+
* This ID doesn't have to be provided by the client,
277+
* services that require it will assign it automatically
278+
* if it's not set.
279+
* @return
280+
*/
263281
void setId(String id);
264282
}

src/main/java/com/rabbitmq/client/NoOpStatistics.java

Lines changed: 15 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
// Copyright (c) 2007-Present Pivotal Software, Inc. All rights reserved.
2+
//
3+
// This software, the RabbitMQ Java client library, is triple-licensed under the
4+
// Mozilla Public License 1.1 ("MPL"), the GNU General Public License version 2
5+
// ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see
6+
// LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. For the ASL,
7+
// please see LICENSE-APACHE2.
8+
//
9+
// This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
10+
// either express or implied. See the LICENSE file for specific language governing
11+
// rights and limitations of this software.
12+
//
13+
// If you have any questions regarding licensing, please contact us at
14+
// info@rabbitmq.com.
15+
116
package com.rabbitmq.client;
217

318
/**
@@ -65,39 +80,4 @@ public void consumedMessage(Channel channel, long deliveryTag, String consumerTa
6580

6681
}
6782

68-
@Override
69-
public void clear() {
70-
71-
}
72-
73-
@Override
74-
public long getConnectionCount() {
75-
return 0;
76-
}
77-
78-
@Override
79-
public long getChannelCount() {
80-
return 0;
81-
}
82-
83-
@Override
84-
public long getPublishedMessageCount() {
85-
return 0;
86-
}
87-
88-
@Override
89-
public long getConsumedMessageCount() {
90-
return 0;
91-
}
92-
93-
@Override
94-
public long getAcknowledgedMessageCount() {
95-
return 0;
96-
}
97-
98< 10000 /td>-
@Override
99-
public long getRejectedMessageCount() {
100-
return 0;
101-
}
102-
10383
}

src/main/java/com/rabbitmq/client/Statistics.java

Lines changed: 0 additions & 22 deletions
This file was deleted.

src/main/java/com/rabbitmq/client/StatisticsCollector.java

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,30 @@
1+
// Copyright (c) 2007-Present Pivotal Software, Inc. All rights reserved.
2+
//
3+
// This software, the RabbitMQ Java client library, is triple-licensed under the
4+
// Mozilla Public License 1.1 ("MPL"), the GNU General Public License version 2
5+
// ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see
6+
// LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. For the ASL,
7+
// please see LICENSE-APACHE2.
8+
//
9+
// This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
10+
// either express or implied. See the LICENSE file for specific language governing
11+
// rights and limitations of this software.
12+
//
13+
// If you have any questions regarding licensing, please contact us at
14+
// info@rabbitmq.com.
15+
116
package com.rabbitmq.client;
217

318
/**
19+
* Interface to gather execution data of the client.
20+
* Note transactions are not supported: they deal with
21+
* publishing and acknowledgments and the collector contract
22+
* assumes then that published messages and acks sent
23+
* in a transaction are always counted, even if the
24+
* transaction is rolled back.
425
*
526
*/
6-
public interface StatisticsCollector extends Statistics {
27+
public interface StatisticsCollector {
728

829
void newConnection(Connection connection);
930

src/main/java/com/rabbitmq/client/impl/AMQConnection.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -924,11 +924,13 @@ public void clearBlockedListeners() {
924924
blockedListeners.clear();
925925
}
926926

927+
/** Public API - {@inheritDoc} */
927928
@Override
928929
public String getId() {
929930
return id;
930931
}
931932

933+
/** Public API - {@inheritDoc} */
932934
@Override
933935
public void setId(String id) {
934936
this.id = id;

0 commit comments

Comments
 (0)
0