You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by pl...@apache.org on 2024/03/20 21:05:13 UTC
(datasketches-characterization) branch go-characterization updated (9de0971 -> 40db86b)
This is an automated email from the ASF dual-hosted git repository.
placave pushed a change to branch go-characterization
in repository https://gitbox.apache.org/repos/asf/datasketches-characterization.git
from 9de0971 [Go] go tidy go.sum
new fbfe02c [Go] Add first characterization job for Go
new 40db86b license
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
README.md | 27 ++++++++++++++++++++++++++-
go/configs.go | 17 +++++++++++++++++
go/datasketches-characterization-go | Bin 0 -> 2392162 bytes
go/go.mod | 2 +-
go/main.go | 30 ++++++++++++++++++++++++++----
go/main_test.go | 17 +++++++++++++++++
6 files changed, 87 insertions(+), 6 deletions(-)
create mode 100755 go/datasketches-characterization-go
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org
(datasketches-characterization) 02/02: license
Posted by pl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
placave pushed a commit to branch go-characterization
in repository https://gitbox.apache.org/repos/asf/datasketches-characterization.git
commit 40db86b174f47900c2af0eb15a0568724ccb519f
Author: Pierre Lacave <pi...@datadoghq.com>
AuthorDate: Wed Mar 20 22:05:02 2024 +0100
license
---
go/configs.go | 17 +++++++++++++++++
go/main_test.go | 17 +++++++++++++++++
2 files changed, 34 insertions(+)
diff --git a/go/configs.go b/go/configs.go
index b63fa46..0be92bf 100644
--- a/go/configs.go
+++ b/go/configs.go
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 main
import "github.com/apache/datasketches-go/hll"
diff --git a/go/main_test.go b/go/main_test.go
index 6dd41e5..73d352b 100644
--- a/go/main_test.go
+++ b/go/main_test.go
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 main
import (
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org
(datasketches-characterization) 01/02: [Go] Add first characterization job for Go
Posted by pl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
placave pushed a commit to branch go-characterization
in repository https://gitbox.apache.org/repos/asf/datasketches-characterization.git
commit fbfe02c140e796d96a348613fc85cc613325be61
Author: Pierre Lacave <pi...@datadoghq.com>
AuthorDate: Wed Mar 20 22:04:17 2024 +0100
[Go] Add first characterization job for Go
---
README.md | 27 ++++++++++++++++++++++++++-
go/datasketches-characterization-go | Bin 0 -> 2392162 bytes
go/go.mod | 2 +-
go/main.go | 30 ++++++++++++++++++++++++++----
4 files changed, 53 insertions(+), 6 deletions(-)
diff --git a/README.md b/README.md
index 11a27d3..a230a15 100644
--- a/README.md
+++ b/README.md
@@ -17,7 +17,7 @@
under the License.
-->
-# Characterization Java & C++ Component
+# Characterization Java, C++ & Go Component
Please visit the main [DataSketches website](https://datasketches.apache.org) for more information.
@@ -110,3 +110,28 @@ After your project is created, open *Project Properties*
#### **Build Project**
After this setup you should be able to *Build Project* from the top-level *Eclipse / Project* Menu. You may need to unselect the *Build Automatically* option.
+## Build Instructions (Go)
+
+### Dependencies
+* Go 1.21 or later is required to compile the Go code.
+
+### Build
+* The project use Go modules, so you can build the project by running the following command:
+ ```
+ go build
+ ```
+
+### Run
+* The project has a main function that runs the characterization tests. You can run the tests by running the following command:
+ ```
+ ./datasketches-characterization <job name>
+ ```
+ or alternatively:
+ ```
+ go run . <job name>
+ ```
+
+ The list of available jobs can be found in the usage of the program:
+ ```
+ ./datasketches-characterization
+ ```
\ No newline at end of file
diff --git a/go/datasketches-characterization-go b/go/datasketches-characterization-go
new file mode 100755
index 0000000..f326791
Binary files /dev/null and b/go/datasketches-characterization-go differ
diff --git a/go/go.mod b/go/go.mod
index 85db448..10e6b51 100644
--- a/go/go.mod
+++ b/go/go.mod
@@ -14,7 +14,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-module github.com/apache/datasketches-characterization/go
+module github.com/apache/datasketches-characterization/datasketches-characterization-go
go 1.21.1
diff --git a/go/main.go b/go/main.go
index 383b915..1ac185f 100644
--- a/go/main.go
+++ b/go/main.go
@@ -17,13 +17,35 @@
package main
-func main() {
+import (
+ "fmt"
+ "os"
+)
- jobs := map[string]JobProfile{
+var (
+ jobs = map[string]JobProfile{
"distinct_count_accuracy_profile": NewDistinctCountAccuracyProfile(distinctCountJobConfig),
}
+)
+
+func usage() {
+ fmt.Println("Usage: go run main.go <job>")
+ fmt.Println("Available jobs:")
+ for job := range jobs {
+ fmt.Println(job)
+ }
+ os.Exit(1)
+}
+
+func main() {
+ if len(os.Args) < 2 || os.Args[1] == "-h" || os.Args[1] == "--help" {
+ usage()
+ }
- for _, job := range jobs {
- job.run()
+ job, ok := jobs[os.Args[1]]
+ if !ok {
+ usage()
}
+
+ job.run()
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org