Closed jeversmann closed 9 years ago
My suggestion, as posted in my mongo-time branch:
Current holds the last seen state of each host:
{
"hostname": "string",
"physical": "boolean",
"user-count": "int",
"users": [
{
"name": "string",
"tty": "string",
"from": "string",
"time": "date"
}
]
}
physical
could be calculated later by filtering across users
, but this
will let us select over it.
Storing multiple users
with the same name will be confusing, so we should
try to keep only the longest running session per user/machine pair.
Session holds a doc for each recorded user session":
{
"username": "string",
"servername": "string",
"hostname": "string",
"time": "date",
"physical": "boolean"
}
hostname
is carried over from user[from]
above; we probably shouldn"t do
anything with it, but we have access to it.
As with before, physical
could be extracted from hostname
, but having it is nice.
If you want a sort of schema, check out mongoose
. I think the idea here is good. I want the raw data stored, and the client to do computation.
I'm starting to want modifications to the original proposal already.
session
, I want a login time and logout time.who.read
runs.current
.Also worth noting, attribute names should be valid with dot syntax, and user-count
is not.
We need a database to store usage times. I don't know how NoSQL works, but I want to be able to store numbers associated with a user and server, so we can select and sum across computers/people. I would propose a schema, but I think that's already missing the point.