Skip to content

Fix script command detailed help #99

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

Merged
merged 1 commit into from
Jul 31, 2025
Merged

Conversation

joamaki
Copy link
Contributor

@joamaki joamaki commented Jul 31, 2025

The db/* command detailed help text wasn't updated after the change to pflag based script flag parsing, e.g. '-columns' should have been '--columns' etc.

Fixes: cc7f961 ("Refactor to use the new flags system in script")

The db/* command detailed help text wasn't updated after the change to
pflag based script flag parsing, e.g. '-columns' should have been
'--columns' etc.

Fixes: cc7f961 ("Refactor to use the new flags system in script")
Signed-off-by: Jussi Maki <jussi@isovalent.com>
@joamaki joamaki requested a review from a team as a code owner July 31, 2025 09:51
@joamaki joamaki requested review from derailed and removed request for a team July 31, 2025 09:51
Copy link

$ make
go build ./...
go: downloading go1.24.0 (linux/amd64)
go: downloading go.yaml.in/yaml/v3 v3.0.3
go: downloading github.com/cilium/hive v0.0.0-20250522123230-2946c4940f41
go: downloading golang.org/x/time v0.5.0
go: downloading github.com/spf13/cobra v1.8.0
go: downloading github.com/spf13/pflag v1.0.5
go: downloading github.com/cilium/stream v0.0.0-20240209152734-a0792b51812d
go: downloading github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de
go: downloading github.com/spf13/viper v1.18.2
go: downloading go.uber.org/dig v1.17.1
go: downloading golang.org/x/term v0.16.0
go: downloading github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
go: downloading github.com/go-viper/mapstructure/v2 v2.2.1
go: downloading golang.org/x/sys v0.17.0
go: downloading golang.org/x/tools v0.17.0
go: downloading github.com/spf13/cast v1.6.0
go: downloading github.com/fsnotify/fsnotify v1.7.0
go: downloading github.com/mitchellh/mapstructure v1.5.0
go: downloading github.com/sagikazarmark/slog-shim v0.1.0
go: downloading github.com/spf13/afero v1.11.0
go: downloading github.com/subosito/gotenv v1.6.0
go: downloading github.com/hashicorp/hcl v1.0.0
go: downloading gopkg.in/ini.v1 v1.67.0
go: downloading github.com/magiconair/properties v1.8.7
go: downloading github.com/pelletier/go-toml/v2 v2.1.0
go: downloading gopkg.in/yaml.v3 v3.0.1
go: downloading golang.org/x/text v0.14.0
go test ./... -cover -vet=all -test.count 1
go: downloading github.com/stretchr/testify v1.8.4
go: downloading go.uber.org/goleak v1.3.0
go: downloading golang.org/x/exp v0.0.0-20240119083558-1b970713d09a
go: downloading github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2
ok  	github.com/cilium/statedb	21.423s	coverage: 83.6% of statements
ok  	github.com/cilium/statedb/index	0.010s	coverage: 28.7% of statements
ok  	github.com/cilium/statedb/internal	0.016s	coverage: 46.7% of statements
ok  	github.com/cilium/statedb/part	4.520s	coverage: 87.6% of statements
ok  	github.com/cilium/statedb/reconciler	0.239s	coverage: 88.5% of statements
	github.com/cilium/statedb/reconciler/benchmark		coverage: 0.0% of statements
	github.com/cilium/statedb/reconciler/example		coverage: 0.0% of statements
go test -race ./... -test.count 1
ok  	github.com/cilium/statedb	94.267s
ok  	github.com/cilium/statedb/index	1.013s
ok  	github.com/cilium/statedb/internal	1.025s
ok  	github.com/cilium/statedb/part	36.926s
ok  	github.com/cilium/statedb/reconciler	1.334s
?   	github.com/cilium/statedb/reconciler/benchmark	[no test files]
?   	github.com/cilium/statedb/reconciler/example	[no test files]
go test ./... -bench . -benchmem -test.run xxx
goos: linux
goarch: amd64
pkg: github.com/cilium/statedb
cpu: AMD EPYC 7763 64-Core Processor                
BenchmarkDB_WriteTxn_1-4                    	  461392	      2209 ns/op	    452623 objects/sec	    1448 B/op	      26 allocs/op
BenchmarkDB_WriteTxn_10-4                   	 1430412	       844.0 ns/op	   1184888 objects/sec	     513 B/op	       9 allocs/op
BenchmarkDB_WriteTxn_100-4                  	 1922595	       624.1 ns/op	   1602306 objects/sec	     431 B/op	       7 allocs/op
BenchmarkDB_WriteTxn_1000-4                 	 1785014	       706.4 ns/op	   1415641 objects/sec	     391 B/op	       7 allocs/op
BenchmarkDB_WriteTxn_100_SecondaryIndex-4   	  544147	      2015 ns/op	    496204 objects/sec	    1258 B/op	      37 allocs/op
BenchmarkDB_NewWriteTxn-4                   	 1513630	       792.3 ns/op	     544 B/op	       8 allocs/op
BenchmarkDB_NewReadTxn-4                    	481705330	         2.491 ns/op	       0 B/op	       0 allocs/op
BenchmarkDB_Modify-4                        	    1666	    736829 ns/op	   1357168 objects/sec	  446409 B/op	    8136 allocs/op
BenchmarkDB_GetInsert-4                     	    1491	    816376 ns/op	   1224926 objects/sec	  430088 B/op	    8135 allocs/op
BenchmarkDB_RandomInsert-4                  	    1786	    685876 ns/op	   1457990 objects/sec	  422649 B/op	    7136 allocs/op
BenchmarkDB_RandomReplace-4                 	     375	   3224580 ns/op	    310118 objects/sec	 2024045 B/op	   49161 allocs/op
BenchmarkDB_SequentialInsert-4              	    1790	    673804 ns/op	   1484112 objects/sec	  391388 B/op	    7110 allocs/op
BenchmarkDB_SequentialInsert_Prefix-4       	     398	   3015509 ns/op	    331619 objects/sec	 3750163 B/op	   58568 allocs/op
BenchmarkDB_Changes_Baseline-4              	    1387	    844889 ns/op	   1183587 objects/sec	  465694 B/op	   10214 allocs/op
BenchmarkDB_Changes-4                       	     817	   1472833 ns/op	    678964 objects/sec	  819870 B/op	   14420 allocs/op
BenchmarkDB_RandomLookup-4                  	   21447	     55776 ns/op	  17928953 objects/sec	       0 B/op	       0 allocs/op
BenchmarkDB_SequentialLookup-4              	   24934	     47661 ns/op	  20981665 objects/sec	       0 B/op	       0 allocs/op
BenchmarkDB_Prefix_SecondaryIndex-4         	    6907	    164402 ns/op	   6082642 objects/sec	  125114 B/op	    1031 allocs/op
BenchmarkDB_FullIteration_All-4             	    1045	   1193742 ns/op	  83770169 objects/sec	     320 B/op	      11 allocs/op
BenchmarkDB_FullIteration_Get-4             	     201	   5836124 ns/op	  17134661 objects/sec	       0 B/op	       0 allocs/op
BenchmarkDB_FullIteration_ReadTxnGet-4      	     201	   5936088 ns/op	  16846113 objects/sec	       0 B/op	       0 allocs/op
BenchmarkDB_PropagationDelay-4              	  571684	      2003 ns/op	        17.00 50th_µs	        20.00 90th_µs	        41.00 99th_µs	    1133 B/op	      22 allocs/op
BenchmarkWatchSet_4-4                       	 1299950	       919.0 ns/op	     499 B/op	       7 allocs/op
BenchmarkWatchSet_16-4                      	  508544	      2391 ns/op	    1699 B/op	       8 allocs/op
BenchmarkWatchSet_128-4                     	   62373	     19299 ns/op	   13407 B/op	       8 allocs/op
BenchmarkWatchSet_1024-4                    	    5780	    192385 ns/op	  105935 B/op	       8 allocs/op
PASS
ok  	github.com/cilium/statedb	33.506s
PASS
ok  	github.com/cilium/statedb/index	0.003s
PASS
ok  	github.com/cilium/statedb/internal	0.003s
goos: linux
goarch: amd64
pkg: github.com/cilium/statedb/part
cpu: AMD EPYC 7763 64-Core Processor                
Benchmark_Uint64Map_Random-4        	    1261	    901397 ns/op	   1109389 items/sec	 2814792 B/op	   11029 allocs/op
Benchmark_Uint64Map_Sequential-4    	    1434	    841315 ns/op	   1188616 items/sec	 2591251 B/op	   11749 allocs/op
Benchmark_Insert_RootOnlyWatch-4    	   10000	    122572 ns/op	   8158497 objects/sec	   90620 B/op	    2044 allocs/op
Benchmark_Insert-4                  	    7045	    173953 ns/op	   5748671 objects/sec	  206590 B/op	    3076 allocs/op
Benchmark_Modify-4                  	   10000	    109754 ns/op	   9111304 objects/sec	  122059 B/op	    1052 allocs/op
Benchmark_GetInsert-4               	    7828	    148094 ns/op	   6752482 objects/sec	  122288 B/op	    1052 allocs/op
Benchmark_Replace-4                 	26680779	        43.78 ns/op	  22842322 objects/sec	       0 B/op	       0 allocs/op
Benchmark_Replace_RootOnlyWatch-4   	27506488	        43.62 ns/op	  22924860 objects/sec	       0 B/op	       0 allocs/op
Benchmark_txn_1-4                   	 3239276	       370.3 ns/op	   2700222 objects/sec	     296 B/op	       5 allocs/op
Benchmark_txn_10-4                  	 8624964	       139.2 ns/op	   7183698 objects/sec	     113 B/op	       2 allocs/op
Benchmark_txn_100-4                 	10079790	       114.9 ns/op	   8705939 objects/sec	     130 B/op	       2 allocs/op
Benchmark_txn_1000-4                	 9383062	       127.1 ns/op	   7869626 objects/sec	     126 B/op	       2 allocs/op
Benchmark_txn_delete_1-4            	 1559696	       764.3 ns/op	   1308388 objects/sec	    3272 B/op	       8 allocs/op
Benchmark_txn_delete_10-4           	 7259721	       162.6 ns/op	   6150207 objects/sec	     368 B/op	       2 allocs/op
Benchmark_txn_delete_100-4          	11503759	       103.8 ns/op	   9631785 objects/sec	      82 B/op	       1 allocs/op
Benchmark_txn_delete_1000-4         	12279613	        97.16 ns/op	  10291963 objects/sec	      28 B/op	       1 allocs/op
Benchmark_Get-4                     	   34011	     35162 ns/op	  28439728 objects/sec	       0 B/op	       0 allocs/op
Benchmark_Iterate-4                 	  169260	      7182 ns/op	 139232770 objects/sec	     104 B/op	       4 allocs/op
Benchmark_Hashmap_Insert-4          	   14959	     80220 ns/op	  12465744 objects/sec	   74265 B/op	      20 allocs/op
Benchmark_Hashmap_Get_Uint64-4      	  138308	      8649 ns/op	 115621076 objects/sec	       0 B/op	       0 allocs/op
Benchmark_Hashmap_Get_Bytes-4       	  112555	     10644 ns/op	  93948360 objects/sec	       0 B/op	       0 allocs/op
PASS
ok  	github.com/cilium/statedb/part	26.887s
PASS
ok  	github.com/cilium/statedb/reconciler	0.004s
?   	github.com/cilium/statedb/reconciler/benchmark	[no test files]
?   	github.com/cilium/statedb/reconciler/example	[no test files]
go run ./reconciler/benchmark -quiet
1000000 objects reconciled in 2.43 seconds (batch size 1000)
Throughput 412347.14 objects per second
1224MB total allocated, 6011126 in-use objects, 384MB bytes in use

@joamaki joamaki merged commit a580859 into main Jul 31, 2025
1 check passed
@joamaki joamaki deleted the pr/joamaki/fix-script-command-help branch July 31, 2025 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants