Skip to content

Commit

Permalink
add the bench test and the license info
Browse files Browse the repository at this point in the history
  • Loading branch information
dbjoa committed Nov 22, 2018
1 parent 33bb20a commit acd7ce5
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
30 changes: 30 additions & 0 deletions util/memory/bench_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Copyright 2018 PingCAP, Inc.
//
// Licensed 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,
// See the License for the specific language governing permissions and
// limitations under the License.

package memory

import (
"testing"
)

func BenchmarkMemTotal(b *testing.B) {
for i := 0; i < b.N; i++ {
_, _ = MemTotal()
}
}

func BenchmarkMemUsed(b *testing.B) {
for i := 0; i < b.N; i++ {
_, _ = MemUsed()
}
}
13 changes: 13 additions & 0 deletions util/memory/meminfo.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
// Copyright 2018 PingCAP, Inc.
//
// Licensed 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,
// See the License for the specific language governing permissions and
// limitations under the License.

package memory

import (
Expand Down

0 comments on commit acd7ce5

Please sign in to comment.