Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update transport #10

Merged
merged 1 commit into from
Jul 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main/java/com/vk/statshouse/Transport.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ synchronized void writeCount(boolean hasEnv, String name, String[] tagsNames, St
synchronized void writeValue(boolean hasEnv, String name, String[] tagsNames, String[] tags, double[] values, long ts) throws IOException {
int fieldMask = VALUE_FIELDS_MASK | NEW_SEMANTIC_FIELDS_MASK;
var now = Instant.now();
for (int i = 0; i < values.length; i++) {
for (int i = 0; i < values.length;) {
var needWriteCount = values.length - i;
var spaceLeft = writeHeader(fieldMask, hasEnv, name, tagsNames, tags, 0, ts, TL_INT_32_SIZE + TL_FLOAT_64_SIZE);
if (spaceLeft < 0) {
Expand All @@ -125,7 +125,7 @@ synchronized void writeValue(boolean hasEnv, String name, String[] tagsNames, St
synchronized void writeUnique(boolean hasEnv, String name, String[] tagsNames, String[] tags, long[] values, long ts) throws IOException {
var fieldMask = UNIQUE_FIELDS_MASK | NEW_SEMANTIC_FIELDS_MASK;
var now = Instant.now();
for (int i = 0; i < values.length; i++) {
for (int i = 0; i < values.length;) {
var needWriteCount = values.length - i;
var spaceLeft = writeHeader(fieldMask, hasEnv, name, tagsNames, tags, 0, ts, TL_INT_32_SIZE + TL_INT_64_SIZE);
if (spaceLeft < 0) {
Expand Down
Loading