2014-04-26 09:18:56 +00:00
|
|
|
package DeviceDatabase
|
|
|
|
|
2014-10-19 17:19:11 +00:00
|
|
|
import (
|
2015-06-22 15:38:55 +00:00
|
|
|
"github.com/SommerEngineering/Ocean/Admin/Scheme"
|
2014-10-19 17:19:11 +00:00
|
|
|
LM "github.com/SommerEngineering/Ocean/Log/Meta"
|
|
|
|
"gopkg.in/mgo.v2"
|
|
|
|
"sync"
|
|
|
|
)
|
2014-04-26 09:18:56 +00:00
|
|
|
|
|
|
|
var (
|
2015-06-23 05:49:59 +00:00
|
|
|
senderName LM.Sender = `System::Logger::Database` // This is the name for logging event from this package
|
|
|
|
mutexCacheFull sync.Mutex = sync.Mutex{} // Mutex for the cache full event
|
|
|
|
mutexCacheSenderNames sync.RWMutex = sync.RWMutex{} // Read/write mutex for the sender names
|
|
|
|
mutexCacheMessageNames sync.RWMutex = sync.RWMutex{} // Read/write mutex for the messages names
|
|
|
|
cache chan LogDBEntry = nil // The cache
|
|
|
|
cacheSizeNumberOfEvents int = 50 // How many events are cached?
|
|
|
|
cacheSizeTime2FlushSeconds int = 6 // Wait how many seconds before forcing to write events?
|
|
|
|
nameCachesRefreshTimeSeconds int = 300 // Wait how many seconds until we reload the sender and message names?
|
|
|
|
cacheSenderNames []Scheme.Sender = nil // Cache for the sender names
|
|
|
|
cacheMessageNames []Scheme.MessageNames = nil // Cache for the message names
|
|
|
|
logDB *mgo.Database = nil // The logging database
|
|
|
|
logDBSession *mgo.Session = nil // The logging database session
|
|
|
|
logDBCollection *mgo.Collection = nil // The logging collection
|
|
|
|
loggingViewerPageSize int = 26 // How many records per page for the logging web viewer?
|
|
|
|
projectName string = `not set` // The project name for the logging
|
|
|
|
isProjectNameSet bool = false // Status about the project name
|
2014-04-26 09:18:56 +00:00
|
|
|
)
|