Sharkey/src/models/stats.ts

202 lines
3.3 KiB
TypeScript
Raw Normal View History

2018-08-18 14:22:56 +03:00
import * as mongo from 'mongodb';
import db from '../db/mongodb';
2018-08-18 18:27:23 +03:00
const Stats = db.get<IStats>('stats');
Stats.createIndex({ date: -1 }, { unique: true });
export default Stats;
2018-08-18 14:22:56 +03:00
2018-08-18 18:27:23 +03:00
export interface IStats {
2018-08-18 14:22:56 +03:00
_id: mongo.ObjectID;
2018-08-25 02:35:41 +03:00
/**
*
*/
2018-08-18 14:22:56 +03:00
date: Date;
2018-08-25 02:35:41 +03:00
/**
*
*/
2018-08-23 09:40:24 +03:00
span: 'day' | 'hour';
2018-08-18 17:48:54 +03:00
/**
*
*/
2018-08-18 14:22:56 +03:00
users: {
local: {
/**
2018-08-25 02:35:41 +03:00
* ()
2018-08-18 14:22:56 +03:00
*/
total: number;
/**
2018-08-25 02:35:41 +03:00
* ()
*/
inc: number;
/**
* ()
2018-08-18 14:22:56 +03:00
*/
2018-08-25 02:35:41 +03:00
dec: number;
2018-08-18 14:22:56 +03:00
};
remote: {
/**
2018-08-25 02:35:41 +03:00
* ()
2018-08-18 14:22:56 +03:00
*/
total: number;
/**
2018-08-25 02:35:41 +03:00
* ()
2018-08-18 14:22:56 +03:00
*/
2018-08-25 02:35:41 +03:00
inc: number;
/**
* ()
*/
dec: number;
2018-08-18 14:22:56 +03:00
};
};
2018-08-18 17:48:54 +03:00
/**
* 稿
*/
2018-08-18 14:22:56 +03:00
notes: {
local: {
/**
2018-08-25 02:35:41 +03:00
* 稿 ()
2018-08-18 14:22:56 +03:00
*/
total: number;
2018-08-18 17:23:55 +03:00
/**
2018-08-25 02:35:41 +03:00
* 稿 ()
2018-08-18 17:23:55 +03:00
*/
2018-08-25 02:35:41 +03:00
inc: number;
/**
* 稿 ()
*/
dec: number;
2018-08-18 17:23:55 +03:00
2018-08-18 14:22:56 +03:00
diffs: {
/**
2018-08-25 02:35:41 +03:00
* 稿 ()
2018-08-18 14:22:56 +03:00
*/
normal: number;
/**
2018-08-25 02:35:41 +03:00
* 稿 ()
2018-08-18 14:22:56 +03:00
*/
reply: number;
/**
2018-08-25 02:35:41 +03:00
* Renoteの投稿数の差分 ()
2018-08-18 14:22:56 +03:00
*/
renote: number;
};
};
remote: {
/**
2018-08-25 02:35:41 +03:00
* 稿 ()
2018-08-18 14:22:56 +03:00
*/
total: number;
2018-08-18 17:23:55 +03:00
/**
2018-08-25 02:35:41 +03:00
* 稿 ()
*/
inc: number;
/**
* 稿 ()
2018-08-18 17:23:55 +03:00
*/
2018-08-25 02:35:41 +03:00
dec: number;
2018-08-18 17:23:55 +03:00
2018-08-18 14:22:56 +03:00
diffs: {
/**
2018-08-25 02:35:41 +03:00
* 稿 ()
2018-08-18 14:22:56 +03:00
*/
normal: number;
/**
2018-08-25 02:35:41 +03:00
* 稿 ()
2018-08-18 14:22:56 +03:00
*/
reply: number;
/**
2018-08-25 02:35:41 +03:00
* Renoteの投稿数の差分 ()
2018-08-18 14:22:56 +03:00
*/
renote: number;
};
};
};
2018-08-18 17:48:54 +03:00
/**
* ()
*/
drive: {
local: {
/**
2018-08-25 02:35:41 +03:00
* ()
2018-08-18 17:48:54 +03:00
*/
totalCount: number;
/**
2018-08-25 02:35:41 +03:00
* ()
2018-08-18 17:48:54 +03:00
*/
totalSize: number;
/**
2018-08-25 02:35:41 +03:00
* ()
*/
incCount: number;
/**
* 使 ()
*/
incSize: number;
/**
* ()
2018-08-18 17:48:54 +03:00
*/
2018-08-25 02:35:41 +03:00
decCount: number;
2018-08-18 17:48:54 +03:00
/**
2018-08-25 02:35:41 +03:00
* 使 ()
2018-08-18 17:48:54 +03:00
*/
2018-08-25 02:35:41 +03:00
decSize: number;
2018-08-18 17:48:54 +03:00
};
remote: {
/**
2018-08-25 02:35:41 +03:00
* ()
2018-08-18 17:48:54 +03:00
*/
totalCount: number;
/**
2018-08-25 02:35:41 +03:00
* ()
2018-08-18 17:48:54 +03:00
*/
totalSize: number;
/**
2018-08-25 02:35:41 +03:00
* ()
*/
incCount: number;
/**
* 使 ()
*/
incSize: number;
/**
* ()
2018-08-18 17:48:54 +03:00
*/
2018-08-25 02:35:41 +03:00
decCount: number;
2018-08-18 17:48:54 +03:00
/**
2018-08-25 02:35:41 +03:00
* 使 ()
2018-08-18 17:48:54 +03:00
*/
2018-08-25 02:35:41 +03:00
decSize: number;
2018-08-18 17:48:54 +03:00
};
};
2018-08-18 14:22:56 +03:00
}