Skip to content

Commit

Permalink
112 add data recorder (#137)
Browse files Browse the repository at this point in the history
* install necessary go modules

* create api for data recorder

* first attempt to data recorder

* update data recorder test

* debug create table mehtod

* debug sqlite reader

* block complex structs out from entry

* debug checkstyle errors

* update testable examples

* complete requested changes

* update v4 to the latest version

* update package comment

* update package comment

* revise unit testing
  • Loading branch information
xuzhongwm authored Sep 5, 2024
1 parent d474d28 commit 1312d4f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 19 deletions.
16 changes: 0 additions & 16 deletions datarecording/datarecorder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,19 +124,3 @@ func TestSQLiteWriter_Flush(t *testing.T) {
assert.Equal(t, 1, id, "ID should match")
assert.Equal(t, "Task1", name, "Name should match")
}

// This test should fail
func TestSQLiteWriter_BlockComplexStructs(t *testing.T) {
writer, _, cleanup := setupTestDB(t)
defer cleanup()

type Attribute struct {
ID int
}

task := struct {
attribute Attribute
}{}

writer.CreateTable("test_table", task)
}
3 changes: 3 additions & 0 deletions datarecording/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Package datarecording offers functionality in writing
// data from each simulation experiment into a databse
package datarecording
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/onsi/gomega v1.34.2
github.com/rs/xid v1.6.0
github.com/shirou/gopsutil v3.21.11+incompatible
github.com/stretchr/testify v1.9.0
github.com/stretchr/testify v1.8.4
github.com/syifan/goseth v0.1.2
github.com/tebeka/atexit v0.3.0
)
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKl
github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/syifan/goseth v0.1.2 h1:b/VG4wboBQNedodAw6wzTz6fdtISSbYIR3ntzRw0J6Q=
github.com/syifan/goseth v0.1.2/go.mod h1:XmguXtbJ2+jSQABDvr3X0uDiYo+7gak39C6BHoWDvYo=
github.com/tebeka/atexit v0.3.0 h1:jleL99H7Ywt80oJKR+VWmJNnezcCOG0CuzcN3CIpsdI=
Expand Down

0 comments on commit 1312d4f

Please sign in to comment.