-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#10704] set the format of the agent inspector table name.
- Loading branch information
1 parent
b18bf05
commit df454c5
Showing
19 changed files
with
284 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
...ctor/src/main/resources/inspector/collector/profiles/local/inspector-collector.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
kafka.inspector.agent.topic.count=1 | ||
kafka.inspector.agent.topic.count=1 | ||
kafka.inspector.agent.topic.prefix=inspector-stat-agent- | ||
kafka.inspector.agent.topic.padding.length=2 |
4 changes: 3 additions & 1 deletion
4
...or/src/main/resources/inspector/collector/profiles/release/inspector-collector.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
kafka.inspector.agent.topic.count=1 | ||
kafka.inspector.agent.topic.count=1 | ||
kafka.inspector.agent.topic.prefix=inspector-stat-agent- | ||
kafka.inspector.agent.topic.padding.length=2 |
31 changes: 31 additions & 0 deletions
31
...r-commons/src/main/java/com/navercorp/pinpoint/common/dao/pinot/AgentStatNameManager.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright 2024 NAVER Corp. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.navercorp.pinpoint.common.dao.pinot; | ||
|
||
import org.apache.kafka.common.utils.Utils; | ||
|
||
import java.nio.charset.StandardCharsets; | ||
|
||
/** | ||
* @author minwoo-jung | ||
*/ | ||
public class AgentStatNameManager { | ||
protected int getHashValue(String applicationName, int agentStatTopicCount) { | ||
int hash = Utils.murmur2(applicationName.getBytes(StandardCharsets.UTF_8)); | ||
return Utils.toPositive(hash) % agentStatTopicCount; | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
...mons/src/main/java/com/navercorp/pinpoint/common/dao/pinot/AgentStatTableNameManager.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright 2024 NAVER Corp. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.navercorp.pinpoint.common.dao.pinot; | ||
|
||
/** | ||
* @author minwoo-jung | ||
*/ | ||
public class AgentStatTableNameManager extends AgentStatNameManager { | ||
|
||
private final String tablePrefix; | ||
private final String numberFormat; | ||
|
||
public AgentStatTableNameManager(String tablePrefix, int paddingLength) { | ||
this.tablePrefix = tablePrefix; | ||
this.numberFormat = "%0" + String.valueOf(paddingLength) + "d"; | ||
} | ||
|
||
public String getAgentStatTableName(String applicationName, int agentStatTopicCount) { | ||
int hashValue = getHashValue(applicationName, agentStatTopicCount); | ||
String postfix = String.format(numberFormat, hashValue); | ||
StringBuilder sb = new StringBuilder(); | ||
sb.append(tablePrefix).append(postfix); | ||
return sb.toString(); | ||
} | ||
|
||
} |
99 changes: 0 additions & 99 deletions
99
.../main/java/com/navercorp/pinpoint/common/dao/pinot/AgentStatTopicAndTableNameManager.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.