Skip to content

Commit

Permalink
Env info - convert 16dot16 to duration (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
AskAlexSharov authored Jun 22, 2021
1 parent f835428 commit 55f88f8
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions mdbx/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"os"
"runtime"
"sync"
"time"
"unsafe"
)

Expand Down Expand Up @@ -332,17 +333,17 @@ type EnvInfo struct {
* \details Overall statistics of page operations of all (running, completed
* and aborted) transactions in the current multi-process session (since the
* first process opened the database). */
PageOps EnfInfoPageOps
LastTxnID int64 // ID of the last committed transaction
MaxReaders uint // maximum number of threads for the environment
NumReaders uint // maximum number of threads used in the environment
PageSize uint //
SystemPageSize uint //
AutoSyncThreshold uint //
SinceSyncSeconds16dot16 uint //
AutosyncPeriodSeconds16dot16 uint //
SinceReaderCheckSeconds16dot16 uint //
Flags uint //
PageOps EnfInfoPageOps
LastTxnID int64 // ID of the last committed transaction
MaxReaders uint // maximum number of threads for the environment
NumReaders uint // maximum number of threads used in the environment
PageSize uint //
SystemPageSize uint //
AutoSyncThreshold uint //
SinceSync time.Duration //
AutosyncPeriod time.Duration //
SinceReaderCheck time.Duration //
Flags uint //
}

// Info returns information about the environment.
Expand Down Expand Up @@ -386,11 +387,11 @@ func (env *Env) Info() (*EnvInfo, error) {
PageSize: uint(_info.mi_dxb_pagesize),
SystemPageSize: uint(_info.mi_sys_pagesize),

AutoSyncThreshold: uint(_info.mi_autosync_threshold),
SinceSyncSeconds16dot16: uint(_info.mi_since_sync_seconds16dot16),
AutosyncPeriodSeconds16dot16: uint(_info.mi_autosync_period_seconds16dot16),
SinceReaderCheckSeconds16dot16: uint(_info.mi_since_reader_check_seconds16dot16),
Flags: uint(_info.mi_mode),
AutoSyncThreshold: uint(_info.mi_autosync_threshold),
SinceSync: toDuration(_info.mi_since_sync_seconds16dot16),
AutosyncPeriod: toDuration(_info.mi_autosync_period_seconds16dot16),
SinceReaderCheck: toDuration(_info.mi_since_reader_check_seconds16dot16),
Flags: uint(_info.mi_mode),
}
return &info, nil
}
Expand Down

0 comments on commit 55f88f8

Please sign in to comment.