This commit is contained in:
@@ -40,6 +40,14 @@ namespace AyaNova.Biz
|
||||
i.e. if I gather every minute, how much can I practically store?
|
||||
Shortest time frame that is shown for DO is 1 minute intervals (6 hour / 360 entries)
|
||||
Timestamp, decimal/float value (need to determine this number type)
|
||||
Number types do has this:
|
||||
CPU avg: 0.33006058073955513
|
||||
transmit bytes: 102.44723488288768
|
||||
receive bytes: 46.078341513002755
|
||||
disk usage avg: (percentage) 30.23570573933185
|
||||
disk sectors written: 0.000136518543824419
|
||||
memory avg: 65.8400891412282
|
||||
load: 0.01
|
||||
Make a chart at client with test data from digital ocean to play with
|
||||
try to replicate their stuff to learn how to best do it
|
||||
Downsampling, should I convert old data to downsampled so I can keep more of it or is this presentation only
|
||||
@@ -49,7 +57,7 @@ namespace AyaNova.Biz
|
||||
hmm... something to consider / experiment with
|
||||
|
||||
Some D.O. charts have max value at top of left axis (y?) that change with the range and values and some have 100% or 1.0 and never change that axis
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -5,11 +5,12 @@ namespace AyaNova.Models
|
||||
{
|
||||
public partial class AyContext : DbContext
|
||||
{
|
||||
public virtual DbSet<MetricCPU> MetricCPU { get; set; }
|
||||
public virtual DbSet<User> User { get; set; }
|
||||
public virtual DbSet<UserOptions> UserOptions { get; set; }
|
||||
public virtual DbSet<Widget> Widget { get; set; }
|
||||
public virtual DbSet<GlobalBizSettings> GlobalBizSettings { get; set; }
|
||||
public virtual DbSet<GlobalOpsBackupSettings> GlobalOpsBackupSettings { get; set; }
|
||||
public virtual DbSet<GlobalOpsBackupSettings> GlobalOpsBackupSettings { get; set; }
|
||||
public virtual DbSet<Event> Event { get; set; }
|
||||
public virtual DbSet<SearchDictionary> SearchDictionary { get; set; }
|
||||
public virtual DbSet<SearchKey> SearchKey { get; set; }
|
||||
@@ -125,7 +126,8 @@ namespace AyaNova.Models
|
||||
modelBuilder.Entity<PM>().Property(z => z.Serial).UseIdentityByDefaultColumn();
|
||||
//modelBuilder.Entity<PurchaseOrder>().Property(z => z.Serial).UseIdentityByDefaultColumn();
|
||||
|
||||
|
||||
|
||||
modelBuilder.Entity<MetricCPU>().HasNoKey();
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//TODO: this entire block is almost certainly wrong or not required
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace AyaNova.Util
|
||||
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImporting WHEN NEW TABLES ADDED!!!!
|
||||
private const int DESIRED_SCHEMA_LEVEL = 11;
|
||||
|
||||
internal const long EXPECTED_COLUMN_COUNT = 310;
|
||||
internal const long EXPECTED_COLUMN_COUNT = 312;
|
||||
internal const long EXPECTED_INDEX_COUNT = 134;
|
||||
|
||||
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImporting WHEN NEW TABLES ADDED!!!!
|
||||
@@ -33,6 +33,7 @@ namespace AyaNova.Util
|
||||
/*
|
||||
|
||||
MAXIMUM POSTGRES OBJECT NAME LENGTH: 63 CHARACTERS
|
||||
CURRENCY: use decimal(19,4)
|
||||
|
||||
HOW TO INDEX
|
||||
|
||||
@@ -242,8 +243,12 @@ namespace AyaNova.Util
|
||||
await ExecQueryAsync("CREATE INDEX aevent_userid_idx ON aevent (userid);");
|
||||
|
||||
|
||||
//SEARCH TABLES
|
||||
//METRICS TABLES
|
||||
//CPU
|
||||
await ExecQueryAsync("CREATE TABLE ametriccpu (t timestamp not null, v double precision not null default 0)");
|
||||
|
||||
|
||||
//SEARCH TABLES
|
||||
await ExecQueryAsync("CREATE TABLE asearchdictionary (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, word varchar(255) not null)");
|
||||
//Must be unique and also this is hit a *lot* during searches and also indexing
|
||||
await ExecQueryAsync("CREATE UNIQUE INDEX asearchdictionary_word_idx ON asearchdictionary (word);");
|
||||
@@ -353,7 +358,7 @@ $BODY$;
|
||||
//Add widget table
|
||||
//id, text, longtext, boolean, currency,
|
||||
await ExecQueryAsync("CREATE TABLE awidget (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name varchar(255) not null unique, serial bigint generated by default as identity not null," +
|
||||
"startdate timestamp, enddate timestamp, dollaramount decimal(19,5), active bool, usertype int4, count integer," +
|
||||
"startdate timestamp, enddate timestamp, dollaramount decimal(19,4), active bool, usertype int4, count integer," +
|
||||
"notes text, userid bigint null, wiki text null, customfields text, tags varchar(255) ARRAY)");
|
||||
|
||||
//TEST TEST TEST ONLY FOR DEVELOPMENT TESTING TO ENSURE UNIQUENESS
|
||||
|
||||
@@ -85,7 +85,22 @@ namespace AyaNova.Util
|
||||
//Erase all the data except for the license, schema and the manager user
|
||||
await DbUtil.EmptyBizDataFromDatabaseForSeedingOrImportingAsync(log);
|
||||
apiServerState.SetOpsOnly("Seeding database with sample data");
|
||||
|
||||
|
||||
|
||||
|
||||
//TEST METRICS SIZE
|
||||
using (var cct = ServiceProviderProvider.DBContext)
|
||||
{
|
||||
var TestCount = 365 * 24 * 60;//525600 minutes in a year
|
||||
for (int i = 0; i < TestCount; i++)
|
||||
{
|
||||
cct.MetricCPU.Add(new MetricCPU() { v = 33.33333 });
|
||||
}
|
||||
cct.SaveChanges();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
//WIDGET sample form customization
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user