-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathindex.tsx
More file actions
53 lines (44 loc) · 1.31 KB
/
index.tsx
File metadata and controls
53 lines (44 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import React from "react"
import CodeBlock from "@theme/CodeBlock"
const InsertDataJava = () => {
return (
<CodeBlock className="language-java">
{`
import io.questdb.cutlass.line.LineTcpSender;
import io.questdb.network.Net;
import io.questdb.std.Os;
public class LineTCPSenderMain {
/*
Maven:
<dependency>
<groupId>org.questdb</groupId>
<artifactId>questdb-client</artifactId>
<version>1.0.1</version>
</dependency>
Gradle:
implementation 'org.questdb:client:1.0.0'
*/
public static void main(String[] args) {
String hostIPv4 = "127.0.0.1";
int port = 9009;
int bufferCapacity = 256 * 1024;
try (LineTcpSender sender = new LineTcpSender(Net.parseIPv4(hostIPv4), port, bufferCapacity)) {
sender
.metric("trades")
.tag("name", "test_ilp1")
.field("value", 12.4)
.$(Os.currentTimeNanos());
sender
.metric("trades")
.tag("name", "test_ilp2")
.field("value", 11.4)
.$(Os.currentTimeNanos());
sender.flush();
}
}
}
`}
</CodeBlock>
)
}
export default InsertDataJava