Skip to content

Commit

Permalink
instrument db calls
Browse files Browse the repository at this point in the history
  • Loading branch information
cbrake committed Oct 27, 2020
1 parent fe658c6 commit 3ca34e1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions db/genji/genji.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package genji
import (
"context"
"encoding/json"
"fmt"
"io"
"log"
"path"
Expand Down Expand Up @@ -114,6 +115,8 @@ func (gen *Db) txNodes(tx *genji.Tx) ([]data.Node, error) {

// Nodes returns all nodes.
func (gen *Db) Nodes() ([]data.Node, error) {
fmt.Println("CLIFF: Nodes +")
defer fmt.Println("CLIFF: Nodes -")
var nodes []data.Node

err := gen.store.View(func(tx *genji.Tx) error {
Expand Down Expand Up @@ -401,6 +404,8 @@ func (u users) Swap(i, j int) {

// Users returns all users, sorted by first name.
func (gen *Db) Users() ([]data.User, error) {
fmt.Println("CLIFF: Users +")
defer fmt.Println("CLIFF: Users -")
var users []data.User
res, err := gen.store.Query(`select * from users order by firstName`)
if err != nil {
Expand Down Expand Up @@ -664,6 +669,9 @@ func (gen *Db) txGroups(tx *genji.Tx) ([]data.Group, error) {

// Groups returns all groups.
func (gen *Db) Groups() ([]data.Group, error) {
fmt.Println("CLIFF: Groups +")
defer fmt.Println("CLIFF: Groups -")

var groups []data.Group

err := gen.store.View(func(tx *genji.Tx) error {
Expand Down

0 comments on commit 3ca34e1

Please sign in to comment.