Changeset 12768


Ignore:
Timestamp:
07/16/15 15:09:12 (6 years ago)
Author:
dglaser
Message:

#2388:

HeuristicLab.Services.Hive.DataAccess-3.3:

  • Removed old statistics tables
  • Updated SQL Scripts

HeuristicLab.Services.WebApp-3.3:
HeuristicLab.Services.WebApp.Status-3.3:
HeuristicLab.Services.WebApp.Statistics-3.3:

  • Minor changes
Location:
branches/HiveStatistics/sources
Files:
3 deleted
19 edited

Legend:

Unmodified
Added
Removed
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml

    r12551 r12768  
    156156    </Type>
    157157  </Table>
    158   <Table Name="" Member="DeletedJobStatistics">
    159     <Type Name="DeletedJobStatistics">
    160       <Column Name="UserId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" />
    161       <Column Name="ExecutionTimeS" Storage="_ExecutionTime" Type="System.Double" DbType="float NOT NULL" CanBeNull="false" />
    162       <Column Name="ExecutionTimeSFinishedJobs" Storage="_ExecutionTimeFinishedJobs" Type="System.Double" DbType="float NOT NULL" CanBeNull="false" />
    163       <Column Name="StartToEndTimeS" Storage="_StartToEndTime" Type="System.Double" DbType="float NOT NULL" CanBeNull="false" />
    164       <Column Name="DeletedJobStatisticsId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
    165     </Type>
    166   </Table>
    167   <Table Name="" Member="UserStatistics">
    168     <Type Name="UserStatistics">
    169       <Column Name="StatisticsId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
    170       <Column Name="UserId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
    171       <Column Name="ExecutionTimeMs" Storage="_ExecutionTime" Type="System.Double" DbType="float NOT NULL" CanBeNull="false" />
    172       <Column Name="UsedCores" Storage="_CoresUsed" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
    173       <Column Name="ExecutionTimeMsFinishedJobs" Storage="_ExecutionTimeFinishedJobs" Type="System.Double" DbType="float NOT NULL" CanBeNull="false" />
    174       <Column Name="StartToEndTimeMs" Storage="_StartToEndTime" Type="System.Double" DbType="float NOT NULL" CanBeNull="false" />
    175       <Association Name="Statistics_UserStatistics" Member="Statistics" ThisKey="StatisticsId" OtherKey="StatisticsId" Type="Statistics" IsForeignKey="true" />
    176     </Type>
    177   </Table>
    178   <Table Name="" Member="SlaveStatistics">
    179     <Type Name="SlaveStatistics">
    180       <Column Name="StatisticsId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
    181       <Column Name="SlaveId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
    182       <Column Name="Cores" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
    183       <Column Name="FreeCores" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
    184       <Column Name="CpuUtilization" Type="System.Double" DbType="float NOT NULL" CanBeNull="false" />
    185       <Column Name="Memory" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
    186       <Column Name="FreeMemory" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
    187       <Association Name="Statistics_SlaveStatistics" Member="Statistics" ThisKey="StatisticsId" OtherKey="StatisticsId" Type="Statistics" IsForeignKey="true" />
    188     </Type>
    189   </Table>
    190   <Table Name="" Member="Statistics">
    191     <Type Name="Statistics">
    192       <Column Name="StatisticsId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
    193       <Column Name="Timestamp" Type="System.DateTime" CanBeNull="false" />
    194       <Association Name="Statistics_UserStatistics" Member="UserStatistics" ThisKey="StatisticsId" OtherKey="StatisticsId" Type="UserStatistics" />
    195       <Association Name="Statistics_SlaveStatistics" Member="SlaveStatistics" ThisKey="StatisticsId" OtherKey="StatisticsId" Type="SlaveStatistics" />
    196     </Type>
    197   </Table>
    198158  <Table Name="dbo.ResourcePermission" Member="ResourcePermissions">
    199159    <Type Name="ResourcePermission">
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml.layout

    r12551 r12768  
    11<?xml version="1.0" encoding="utf-8"?>
    2 <ordesignerObjectsDiagram dslVersion="1.0.0.0" absoluteBounds="0, 0, 24.25, 17.875" name="HiveDataContext">
     2<ordesignerObjectsDiagram dslVersion="1.0.0.0" absoluteBounds="0, 0, 15.75, 17.875" name="HiveDataContext">
    33  <DataContextMoniker Name="/HiveDataContext" />
    44  <nestedChildShapes>
     
    134134      </nestedChildShapes>
    135135    </classShape>
    136     <classShape Id="cdddf4da-eaef-46a1-9cfd-987bb6b3d03e" absoluteBounds="17, 3.125, 2.5, 1.7708968098958327">
    137       <DataClassMoniker Name="/HiveDataContext/DeletedJobStatistics" />
    138       <nestedChildShapes>
    139         <elementListCompartment Id="b8738381-f696-4dba-a517-47e9cd96a9a6" absoluteBounds="17.015, 3.585, 2.4699999999999998, 1.2108968098958333" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
    140       </nestedChildShapes>
    141     </classShape>
    142     <classShape Id="25442617-ff41-49a0-b5d5-4cbe0b2f0f45" absoluteBounds="22, 4.5, 2, 1.9631982421874996">
    143       <DataClassMoniker Name="/HiveDataContext/UserStatistics" />
    144       <nestedChildShapes>
    145         <elementListCompartment Id="6edf08e7-054a-4253-8d4f-5bf2dfec2d29" absoluteBounds="22.015, 4.96, 1.9700000000000002, 1.4031982421875" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
    146       </nestedChildShapes>
    147     </classShape>
    148     <classShape Id="f78ec989-4862-4bac-87e3-9b0aad4bc037" absoluteBounds="19.875, 4.5, 2, 2.1554996744791666">
    149       <DataClassMoniker Name="/HiveDataContext/SlaveStatistics" />
    150       <nestedChildShapes>
    151         <elementListCompartment Id="98cb46fe-820e-4041-aee8-04e8bed3df23" absoluteBounds="19.89, 4.96, 1.9700000000000002, 1.5954996744791665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
    152       </nestedChildShapes>
    153     </classShape>
    154     <classShape Id="4d9f0606-b7ee-4dae-a8ac-aff88d25a941" absoluteBounds="21, 3, 2, 1.1939925130208327">
    155       <DataClassMoniker Name="/HiveDataContext/Statistics" />
    156       <nestedChildShapes>
    157         <elementListCompartment Id="17821282-8edf-40b7-9065-84f53391d5c1" absoluteBounds="21.015, 3.46, 1.9700000000000002, 0.63399251302083326" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
    158       </nestedChildShapes>
    159     </classShape>
    160     <associationConnector edgePoints="[(21.4375 : 4.19399251302083); (21.4375 : 4.5)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    161       <AssociationMoniker Name="/HiveDataContext/Statistics/Statistics_SlaveStatistics" />
    162       <nodes>
    163         <classShapeMoniker Id="4d9f0606-b7ee-4dae-a8ac-aff88d25a941" />
    164         <classShapeMoniker Id="f78ec989-4862-4bac-87e3-9b0aad4bc037" />
    165       </nodes>
    166     </associationConnector>
    167     <associationConnector edgePoints="[(22.5 : 4.19399251302083); (22.5 : 4.5)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    168       <AssociationMoniker Name="/HiveDataContext/Statistics/Statistics_UserStatistics" />
    169       <nodes>
    170         <classShapeMoniker Id="4d9f0606-b7ee-4dae-a8ac-aff88d25a941" />
    171         <classShapeMoniker Id="25442617-ff41-49a0-b5d5-4cbe0b2f0f45" />
    172       </nodes>
    173     </associationConnector>
    174136    <associationConnector edgePoints="[(13.25 : 2.73159912109375); (13.5 : 2.73159912109375)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    175137      <AssociationMoniker Name="/HiveDataContext/Resource/Resource_Downtime" />
     
    297259      </nodes>
    298260    </associationConnector>
    299     <associationConnector edgePoints="[(5.6249975 : 15.25); (5.6249975 : 12.6546541341146); (4.625 : 12.6546541341146)]" fixedFrom="Algorithm" fixedTo="Algorithm">
     261    <associationConnector edgePoints="[(5.6249975 : 15.25); (5.6249975 : 12.6546541341146); (4.625 : 12.6546541341146)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    300262      <AssociationMoniker Name="/HiveDataContext/DimClient/DimClient_FactClientInfo" />
    301263      <nodes>
     
    304266      </nodes>
    305267    </associationConnector>
    306     <associationConnector edgePoints="[(4.125 : 10.4631982421875); (4.125 : 11)]" fixedFrom="Algorithm" fixedTo="Algorithm">
     268    <associationConnector edgePoints="[(4.125 : 10.4631982421875); (4.125 : 11)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    307269      <AssociationMoniker Name="/HiveDataContext/DimTime/DimTime_FactClientInfo" />
    308270      <nodes>
     
    311273      </nodes>
    312274    </associationConnector>
    313     <associationConnector edgePoints="[(1.59375 : 10.0689925130208); (1.59375 : 12.6546541341146); (2.625 : 12.6546541341146)]" fixedFrom="Algorithm" fixedTo="Algorithm">
     275    <associationConnector edgePoints="[(1.59375 : 10.0689925130208); (1.59375 : 12.6546541341146); (2.625 : 12.6546541341146)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    314276      <AssociationMoniker Name="/HiveDataContext/DimUser/DimUser_FactClientInfo" />
    315277      <nodes>
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.designer.cs

    r12551 r12768  
    6767    partial void UpdateLifecycle(Lifecycle instance);
    6868    partial void DeleteLifecycle(Lifecycle instance);
    69     partial void InsertDeletedJobStatistics(DeletedJobStatistics instance);
    70     partial void UpdateDeletedJobStatistics(DeletedJobStatistics instance);
    71     partial void DeleteDeletedJobStatistics(DeletedJobStatistics instance);
    72     partial void InsertUserStatistics(UserStatistics instance);
    73     partial void UpdateUserStatistics(UserStatistics instance);
    74     partial void DeleteUserStatistics(UserStatistics instance);
    75     partial void InsertSlaveStatistics(SlaveStatistics instance);
    76     partial void UpdateSlaveStatistics(SlaveStatistics instance);
    77     partial void DeleteSlaveStatistics(SlaveStatistics instance);
    78     partial void InsertStatistics(Statistics instance);
    79     partial void UpdateStatistics(Statistics instance);
    80     partial void DeleteStatistics(Statistics instance);
    8169    partial void InsertResourcePermission(ResourcePermission instance);
    8270    partial void UpdateResourcePermission(ResourcePermission instance);
     
    228216      {
    229217        return this.GetTable<Lifecycle>();
    230       }
    231     }
    232    
    233     public System.Data.Linq.Table<DeletedJobStatistics> DeletedJobStatistics
    234     {
    235       get
    236       {
    237         return this.GetTable<DeletedJobStatistics>();
    238       }
    239     }
    240    
    241     public System.Data.Linq.Table<UserStatistics> UserStatistics
    242     {
    243       get
    244       {
    245         return this.GetTable<UserStatistics>();
    246       }
    247     }
    248    
    249     public System.Data.Linq.Table<SlaveStatistics> SlaveStatistics
    250     {
    251       get
    252       {
    253         return this.GetTable<SlaveStatistics>();
    254       }
    255     }
    256    
    257     public System.Data.Linq.Table<Statistics> Statistics
    258     {
    259       get
    260       {
    261         return this.GetTable<Statistics>();
    262218      }
    263219    }
     
    35913547        this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
    35923548      }
    3593     }
    3594   }
    3595  
    3596   [global::System.Data.Linq.Mapping.TableAttribute(Name="")]
    3597   public partial class DeletedJobStatistics : INotifyPropertyChanging, INotifyPropertyChanged
    3598   {
    3599    
    3600     private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
    3601    
    3602     private System.Guid _UserId;
    3603    
    3604     private double _ExecutionTime;
    3605    
    3606     private double _ExecutionTimeFinishedJobs;
    3607    
    3608     private double _StartToEndTime;
    3609    
    3610     private System.Guid _DeletedJobStatisticsId;
    3611    
    3612     #region Extensibility Method Definitions
    3613     partial void OnLoaded();
    3614     partial void OnValidate(System.Data.Linq.ChangeAction action);
    3615     partial void OnCreated();
    3616     partial void OnUserIdChanging(System.Guid value);
    3617     partial void OnUserIdChanged();
    3618     partial void OnExecutionTimeSChanging(double value);
    3619     partial void OnExecutionTimeSChanged();
    3620     partial void OnExecutionTimeSFinishedJobsChanging(double value);
    3621     partial void OnExecutionTimeSFinishedJobsChanged();
    3622     partial void OnStartToEndTimeSChanging(double value);
    3623     partial void OnStartToEndTimeSChanged();
    3624     partial void OnDeletedJobStatisticsIdChanging(System.Guid value);
    3625     partial void OnDeletedJobStatisticsIdChanged();
    3626     #endregion
    3627    
    3628     public DeletedJobStatistics()
    3629     {
    3630       OnCreated();
    3631     }
    3632    
    3633     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserId", DbType="UniqueIdentifier NOT NULL")]
    3634     public System.Guid UserId
    3635     {
    3636       get
    3637       {
    3638         return this._UserId;
    3639       }
    3640       set
    3641       {
    3642         if ((this._UserId != value))
    3643         {
    3644           this.OnUserIdChanging(value);
    3645           this.SendPropertyChanging();
    3646           this._UserId = value;
    3647           this.SendPropertyChanged("UserId");
    3648           this.OnUserIdChanged();
    3649         }
    3650       }
    3651     }
    3652    
    3653     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ExecutionTime", DbType="float NOT NULL")]
    3654     public double ExecutionTimeS
    3655     {
    3656       get
    3657       {
    3658         return this._ExecutionTime;
    3659       }
    3660       set
    3661       {
    3662         if ((this._ExecutionTime != value))
    3663         {
    3664           this.OnExecutionTimeSChanging(value);
    3665           this.SendPropertyChanging();
    3666           this._ExecutionTime = value;
    3667           this.SendPropertyChanged("ExecutionTimeS");
    3668           this.OnExecutionTimeSChanged();
    3669         }
    3670       }
    3671     }
    3672    
    3673     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ExecutionTimeFinishedJobs", DbType="float NOT NULL")]
    3674     public double ExecutionTimeSFinishedJobs
    3675     {
    3676       get
    3677       {
    3678         return this._ExecutionTimeFinishedJobs;
    3679       }
    3680       set
    3681       {
    3682         if ((this._ExecutionTimeFinishedJobs != value))
    3683         {
    3684           this.OnExecutionTimeSFinishedJobsChanging(value);
    3685           this.SendPropertyChanging();
    3686           this._ExecutionTimeFinishedJobs = value;
    3687           this.SendPropertyChanged("ExecutionTimeSFinishedJobs");
    3688           this.OnExecutionTimeSFinishedJobsChanged();
    3689         }
    3690       }
    3691     }
    3692    
    3693     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_StartToEndTime", DbType="float NOT NULL")]
    3694     public double StartToEndTimeS
    3695     {
    3696       get
    3697       {
    3698         return this._StartToEndTime;
    3699       }
    3700       set
    3701       {
    3702         if ((this._StartToEndTime != value))
    3703         {
    3704           this.OnStartToEndTimeSChanging(value);
    3705           this.SendPropertyChanging();
    3706           this._StartToEndTime = value;
    3707           this.SendPropertyChanged("StartToEndTimeS");
    3708           this.OnStartToEndTimeSChanged();
    3709         }
    3710       }
    3711     }
    3712    
    3713     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DeletedJobStatisticsId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]
    3714     public System.Guid DeletedJobStatisticsId
    3715     {
    3716       get
    3717       {
    3718         return this._DeletedJobStatisticsId;
    3719       }
    3720       set
    3721       {
    3722         if ((this._DeletedJobStatisticsId != value))
    3723         {
    3724           this.OnDeletedJobStatisticsIdChanging(value);
    3725           this.SendPropertyChanging();
    3726           this._DeletedJobStatisticsId = value;
    3727           this.SendPropertyChanged("DeletedJobStatisticsId");
    3728           this.OnDeletedJobStatisticsIdChanged();
    3729         }
    3730       }
    3731     }
    3732    
    3733     public event PropertyChangingEventHandler PropertyChanging;
    3734    
    3735     public event PropertyChangedEventHandler PropertyChanged;
    3736    
    3737     protected virtual void SendPropertyChanging()
    3738     {
    3739       if ((this.PropertyChanging != null))
    3740       {
    3741         this.PropertyChanging(this, emptyChangingEventArgs);
    3742       }
    3743     }
    3744    
    3745     protected virtual void SendPropertyChanged(String propertyName)
    3746     {
    3747       if ((this.PropertyChanged != null))
    3748       {
    3749         this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
    3750       }
    3751     }
    3752   }
    3753  
    3754   [global::System.Data.Linq.Mapping.TableAttribute(Name="")]
    3755   public partial class UserStatistics : INotifyPropertyChanging, INotifyPropertyChanged
    3756   {
    3757    
    3758     private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
    3759    
    3760     private System.Guid _StatisticsId;
    3761    
    3762     private System.Guid _UserId;
    3763    
    3764     private double _ExecutionTime;
    3765    
    3766     private int _CoresUsed;
    3767    
    3768     private double _ExecutionTimeFinishedJobs;
    3769    
    3770     private double _StartToEndTime;
    3771    
    3772     private EntityRef<Statistics> _Statistics;
    3773    
    3774     #region Extensibility Method Definitions
    3775     partial void OnLoaded();
    3776     partial void OnValidate(System.Data.Linq.ChangeAction action);
    3777     partial void OnCreated();
    3778     partial void OnStatisticsIdChanging(System.Guid value);
    3779     partial void OnStatisticsIdChanged();
    3780     partial void OnUserIdChanging(System.Guid value);
    3781     partial void OnUserIdChanged();
    3782     partial void OnExecutionTimeMsChanging(double value);
    3783     partial void OnExecutionTimeMsChanged();
    3784     partial void OnUsedCoresChanging(int value);
    3785     partial void OnUsedCoresChanged();
    3786     partial void OnExecutionTimeMsFinishedJobsChanging(double value);
    3787     partial void OnExecutionTimeMsFinishedJobsChanged();
    3788     partial void OnStartToEndTimeMsChanging(double value);
    3789     partial void OnStartToEndTimeMsChanged();
    3790     #endregion
    3791    
    3792     public UserStatistics()
    3793     {
    3794       this._Statistics = default(EntityRef<Statistics>);
    3795       OnCreated();
    3796     }
    3797    
    3798     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_StatisticsId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
    3799     public System.Guid StatisticsId
    3800     {
    3801       get
    3802       {
    3803         return this._StatisticsId;
    3804       }
    3805       set
    3806       {
    3807         if ((this._StatisticsId != value))
    3808         {
    3809           if (this._Statistics.HasLoadedOrAssignedValue)
    3810           {
    3811             throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
    3812           }
    3813           this.OnStatisticsIdChanging(value);
    3814           this.SendPropertyChanging();
    3815           this._StatisticsId = value;
    3816           this.SendPropertyChanged("StatisticsId");
    3817           this.OnStatisticsIdChanged();
    3818         }
    3819       }
    3820     }
    3821    
    3822     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
    3823     public System.Guid UserId
    3824     {
    3825       get
    3826       {
    3827         return this._UserId;
    3828       }
    3829       set
    3830       {
    3831         if ((this._UserId != value))
    3832         {
    3833           this.OnUserIdChanging(value);
    3834           this.SendPropertyChanging();
    3835           this._UserId = value;
    3836           this.SendPropertyChanged("UserId");
    3837           this.OnUserIdChanged();
    3838         }
    3839       }
    3840     }
    3841    
    3842     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ExecutionTime", DbType="float NOT NULL")]
    3843     public double ExecutionTimeMs
    3844     {
    3845       get
    3846       {
    3847         return this._ExecutionTime;
    3848       }
    3849       set
    3850       {
    3851         if ((this._ExecutionTime != value))
    3852         {
    3853           this.OnExecutionTimeMsChanging(value);
    3854           this.SendPropertyChanging();
    3855           this._ExecutionTime = value;
    3856           this.SendPropertyChanged("ExecutionTimeMs");
    3857           this.OnExecutionTimeMsChanged();
    3858         }
    3859       }
    3860     }
    3861    
    3862     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CoresUsed", DbType="Int NOT NULL")]
    3863     public int UsedCores
    3864     {
    3865       get
    3866       {
    3867         return this._CoresUsed;
    3868       }
    3869       set
    3870       {
    3871         if ((this._CoresUsed != value))
    3872         {
    3873           this.OnUsedCoresChanging(value);
    3874           this.SendPropertyChanging();
    3875           this._CoresUsed = value;
    3876           this.SendPropertyChanged("UsedCores");
    3877           this.OnUsedCoresChanged();
    3878         }
    3879       }
    3880     }
    3881    
    3882     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ExecutionTimeFinishedJobs", DbType="float NOT NULL")]
    3883     public double ExecutionTimeMsFinishedJobs
    3884     {
    3885       get
    3886       {
    3887         return this._ExecutionTimeFinishedJobs;
    3888       }
    3889       set
    3890       {
    3891         if ((this._ExecutionTimeFinishedJobs != value))
    3892         {
    3893           this.OnExecutionTimeMsFinishedJobsChanging(value);
    3894           this.SendPropertyChanging();
    3895           this._ExecutionTimeFinishedJobs = value;
    3896           this.SendPropertyChanged("ExecutionTimeMsFinishedJobs");
    3897           this.OnExecutionTimeMsFinishedJobsChanged();
    3898         }
    3899       }
    3900     }
    3901    
    3902     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_StartToEndTime", DbType="float NOT NULL")]
    3903     public double StartToEndTimeMs
    3904     {
    3905       get
    3906       {
    3907         return this._StartToEndTime;
    3908       }
    3909       set
    3910       {
    3911         if ((this._StartToEndTime != value))
    3912         {
    3913           this.OnStartToEndTimeMsChanging(value);
    3914           this.SendPropertyChanging();
    3915           this._StartToEndTime = value;
    3916           this.SendPropertyChanged("StartToEndTimeMs");
    3917           this.OnStartToEndTimeMsChanged();
    3918         }
    3919       }
    3920     }
    3921    
    3922     [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Statistics_UserStatistics", Storage="_Statistics", ThisKey="StatisticsId", OtherKey="StatisticsId", IsForeignKey=true)]
    3923     public Statistics Statistics
    3924     {
    3925       get
    3926       {
    3927         return this._Statistics.Entity;
    3928       }
    3929       set
    3930       {
    3931         Statistics previousValue = this._Statistics.Entity;
    3932         if (((previousValue != value)
    3933               || (this._Statistics.HasLoadedOrAssignedValue == false)))
    3934         {
    3935           this.SendPropertyChanging();
    3936           if ((previousValue != null))
    3937           {
    3938             this._Statistics.Entity = null;
    3939             previousValue.UserStatistics.Remove(this);
    3940           }
    3941           this._Statistics.Entity = value;
    3942           if ((value != null))
    3943           {
    3944             value.UserStatistics.Add(this);
    3945             this._StatisticsId = value.StatisticsId;
    3946           }
    3947           else
    3948           {
    3949             this._StatisticsId = default(System.Guid);
    3950           }
    3951           this.SendPropertyChanged("Statistics");
    3952         }
    3953       }
    3954     }
    3955    
    3956     public event PropertyChangingEventHandler PropertyChanging;
    3957    
    3958     public event PropertyChangedEventHandler PropertyChanged;
    3959    
    3960     protected virtual void SendPropertyChanging()
    3961     {
    3962       if ((this.PropertyChanging != null))
    3963       {
    3964         this.PropertyChanging(this, emptyChangingEventArgs);
    3965       }
    3966     }
    3967    
    3968     protected virtual void SendPropertyChanged(String propertyName)
    3969     {
    3970       if ((this.PropertyChanged != null))
    3971       {
    3972         this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
    3973       }
    3974     }
    3975   }
    3976  
    3977   [global::System.Data.Linq.Mapping.TableAttribute(Name="")]
    3978   public partial class SlaveStatistics : INotifyPropertyChanging, INotifyPropertyChanged
    3979   {
    3980    
    3981     private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
    3982    
    3983     private System.Guid _StatisticsId;
    3984    
    3985     private System.Guid _SlaveId;
    3986    
    3987     private int _Cores;
    3988    
    3989     private int _FreeCores;
    3990    
    3991     private double _CpuUtilization;
    3992    
    3993     private int _Memory;
    3994    
    3995     private int _FreeMemory;
    3996    
    3997     private EntityRef<Statistics> _Statistics;
    3998    
    3999     #region Extensibility Method Definitions
    4000     partial void OnLoaded();
    4001     partial void OnValidate(System.Data.Linq.ChangeAction action);
    4002     partial void OnCreated();
    4003     partial void OnStatisticsIdChanging(System.Guid value);
    4004     partial void OnStatisticsIdChanged();
    4005     partial void OnSlaveIdChanging(System.Guid value);
    4006     partial void OnSlaveIdChanged();
    4007     partial void OnCoresChanging(int value);
    4008     partial void OnCoresChanged();
    4009     partial void OnFreeCoresChanging(int value);
    4010     partial void OnFreeCoresChanged();
    4011     partial void OnCpuUtilizationChanging(double value);
    4012     partial void OnCpuUtilizationChanged();
    4013     partial void OnMemoryChanging(int value);
    4014     partial void OnMemoryChanged();
    4015     partial void OnFreeMemoryChanging(int value);
    4016     partial void OnFreeMemoryChanged();
    4017     #endregion
    4018    
    4019     public SlaveStatistics()
    4020     {
    4021       this._Statistics = default(EntityRef<Statistics>);
    4022       OnCreated();
    4023     }
    4024    
    4025     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_StatisticsId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
    4026     public System.Guid StatisticsId
    4027     {
    4028       get
    4029       {
    4030         return this._StatisticsId;
    4031       }
    4032       set
    4033       {
    4034         if ((this._StatisticsId != value))
    4035         {
    4036           if (this._Statistics.HasLoadedOrAssignedValue)
    4037           {
    4038             throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
    4039           }
    4040           this.OnStatisticsIdChanging(value);
    4041           this.SendPropertyChanging();
    4042           this._StatisticsId = value;
    4043           this.SendPropertyChanged("StatisticsId");
    4044           this.OnStatisticsIdChanged();
    4045         }
    4046       }
    4047     }
    4048    
    4049     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SlaveId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
    4050     public System.Guid SlaveId
    4051     {
    4052       get
    4053       {
    4054         return this._SlaveId;
    4055       }
    4056       set
    4057       {
    4058         if ((this._SlaveId != value))
    4059         {
    4060           this.OnSlaveIdChanging(value);
    4061           this.SendPropertyChanging();
    4062           this._SlaveId = value;
    4063           this.SendPropertyChanged("SlaveId");
    4064           this.OnSlaveIdChanged();
    4065         }
    4066       }
    4067     }
    4068    
    4069     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Cores", DbType="Int NOT NULL")]
    4070     public int Cores
    4071     {
    4072       get
    4073       {
    4074         return this._Cores;
    4075       }
    4076       set
    4077       {
    4078         if ((this._Cores != value))
    4079         {
    4080           this.OnCoresChanging(value);
    4081           this.SendPropertyChanging();
    4082           this._Cores = value;
    4083           this.SendPropertyChanged("Cores");
    4084           this.OnCoresChanged();
    4085         }
    4086       }
    4087     }
    4088    
    4089     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_FreeCores", DbType="Int NOT NULL")]
    4090     public int FreeCores
    4091     {
    4092       get
    4093       {
    4094         return this._FreeCores;
    4095       }
    4096       set
    4097       {
    4098         if ((this._FreeCores != value))
    4099         {
    4100           this.OnFreeCoresChanging(value);
    4101           this.SendPropertyChanging();
    4102           this._FreeCores = value;
    4103           this.SendPropertyChanged("FreeCores");
    4104           this.OnFreeCoresChanged();
    4105         }
    4106       }
    4107     }
    4108    
    4109     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CpuUtilization", DbType="float NOT NULL")]
    4110     public double CpuUtilization
    4111     {
    4112       get
    4113       {
    4114         return this._CpuUtilization;
    4115       }
    4116       set
    4117       {
    4118         if ((this._CpuUtilization != value))
    4119         {
    4120           this.OnCpuUtilizationChanging(value);
    4121           this.SendPropertyChanging();
    4122           this._CpuUtilization = value;
    4123           this.SendPropertyChanged("CpuUtilization");
    4124           this.OnCpuUtilizationChanged();
    4125         }
    4126       }
    4127     }
    4128    
    4129     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Memory", DbType="Int NOT NULL")]
    4130     public int Memory
    4131     {
    4132       get
    4133       {
    4134         return this._Memory;
    4135       }
    4136       set
    4137       {
    4138         if ((this._Memory != value))
    4139         {
    4140           this.OnMemoryChanging(value);
    4141           this.SendPropertyChanging();
    4142           this._Memory = value;
    4143           this.SendPropertyChanged("Memory");
    4144           this.OnMemoryChanged();
    4145         }
    4146       }
    4147     }
    4148    
    4149     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_FreeMemory", DbType="Int NOT NULL")]
    4150     public int FreeMemory
    4151     {
    4152       get
    4153       {
    4154         return this._FreeMemory;
    4155       }
    4156       set
    4157       {
    4158         if ((this._FreeMemory != value))
    4159         {
    4160           this.OnFreeMemoryChanging(value);
    4161           this.SendPropertyChanging();
    4162           this._FreeMemory = value;
    4163           this.SendPropertyChanged("FreeMemory");
    4164           this.OnFreeMemoryChanged();
    4165         }
    4166       }
    4167     }
    4168    
    4169     [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Statistics_SlaveStatistics", Storage="_Statistics", ThisKey="StatisticsId", OtherKey="StatisticsId", IsForeignKey=true)]
    4170     public Statistics Statistics
    4171     {
    4172       get
    4173       {
    4174         return this._Statistics.Entity;
    4175       }
    4176       set
    4177       {
    4178         Statistics previousValue = this._Statistics.Entity;
    4179         if (((previousValue != value)
    4180               || (this._Statistics.HasLoadedOrAssignedValue == false)))
    4181         {
    4182           this.SendPropertyChanging();
    4183           if ((previousValue != null))
    4184           {
    4185             this._Statistics.Entity = null;
    4186             previousValue.SlaveStatistics.Remove(this);
    4187           }
    4188           this._Statistics.Entity = value;
    4189           if ((value != null))
    4190           {
    4191             value.SlaveStatistics.Add(this);
    4192             this._StatisticsId = value.StatisticsId;
    4193           }
    4194           else
    4195           {
    4196             this._StatisticsId = default(System.Guid);
    4197           }
    4198           this.SendPropertyChanged("Statistics");
    4199         }
    4200       }
    4201     }
    4202    
    4203     public event PropertyChangingEventHandler PropertyChanging;
    4204    
    4205     public event PropertyChangedEventHandler PropertyChanged;
    4206    
    4207     protected virtual void SendPropertyChanging()
    4208     {
    4209       if ((this.PropertyChanging != null))
    4210       {
    4211         this.PropertyChanging(this, emptyChangingEventArgs);
    4212       }
    4213     }
    4214    
    4215     protected virtual void SendPropertyChanged(String propertyName)
    4216     {
    4217       if ((this.PropertyChanged != null))
    4218       {
    4219         this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
    4220       }
    4221     }
    4222   }
    4223  
    4224   [global::System.Data.Linq.Mapping.TableAttribute(Name="")]
    4225   public partial class Statistics : INotifyPropertyChanging, INotifyPropertyChanged
    4226   {
    4227    
    4228     private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
    4229    
    4230     private System.Guid _StatisticsId;
    4231    
    4232     private System.DateTime _Timestamp;
    4233    
    4234     private EntitySet<UserStatistics> _UserStatistics;
    4235    
    4236     private EntitySet<SlaveStatistics> _SlaveStatistics;
    4237    
    4238     #region Extensibility Method Definitions
    4239     partial void OnLoaded();
    4240     partial void OnValidate(System.Data.Linq.ChangeAction action);
    4241     partial void OnCreated();
    4242     partial void OnStatisticsIdChanging(System.Guid value);
    4243     partial void OnStatisticsIdChanged();
    4244     partial void OnTimestampChanging(System.DateTime value);
    4245     partial void OnTimestampChanged();
    4246     #endregion
    4247    
    4248     public Statistics()
    4249     {
    4250       this._UserStatistics = new EntitySet<UserStatistics>(new Action<UserStatistics>(this.attach_UserStatistics), new Action<UserStatistics>(this.detach_UserStatistics));
    4251       this._SlaveStatistics = new EntitySet<SlaveStatistics>(new Action<SlaveStatistics>(this.attach_SlaveStatistics), new Action<SlaveStatistics>(this.detach_SlaveStatistics));
    4252       OnCreated();
    4253     }
    4254    
    4255     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_StatisticsId", AutoSync=AutoSync.OnInsert, DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, IsDbGenerated=true)]
    4256     public System.Guid StatisticsId
    4257     {
    4258       get
    4259       {
    4260         return this._StatisticsId;
    4261       }
    4262       set
    4263       {
    4264         if ((this._StatisticsId != value))
    4265         {
    4266           this.OnStatisticsIdChanging(value);
    4267           this.SendPropertyChanging();
    4268           this._StatisticsId = value;
    4269           this.SendPropertyChanged("StatisticsId");
    4270           this.OnStatisticsIdChanged();
    4271         }
    4272       }
    4273     }
    4274    
    4275     [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Timestamp")]
    4276     public System.DateTime Timestamp
    4277     {
    4278       get
    4279       {
    4280         return this._Timestamp;
    4281       }
    4282       set
    4283       {
    4284         if ((this._Timestamp != value))
    4285         {
    4286           this.OnTimestampChanging(value);
    4287           this.SendPropertyChanging();
    4288           this._Timestamp = value;
    4289           this.SendPropertyChanged("Timestamp");
    4290           this.OnTimestampChanged();
    4291         }
    4292       }
    4293     }
    4294    
    4295     [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Statistics_UserStatistics", Storage="_UserStatistics", ThisKey="StatisticsId", OtherKey="StatisticsId")]
    4296     public EntitySet<UserStatistics> UserStatistics
    4297     {
    4298       get
    4299       {
    4300         return this._UserStatistics;
    4301       }
    4302       set
    4303       {
    4304         this._UserStatistics.Assign(value);
    4305       }
    4306     }
    4307    
    4308     [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Statistics_SlaveStatistics", Storage="_SlaveStatistics", ThisKey="StatisticsId", OtherKey="StatisticsId")]
    4309     public EntitySet<SlaveStatistics> SlaveStatistics
    4310     {
    4311       get
    4312       {
    4313         return this._SlaveStatistics;
    4314       }
    4315       set
    4316       {
    4317         this._SlaveStatistics.Assign(value);
    4318       }
    4319     }
    4320    
    4321     public event PropertyChangingEventHandler PropertyChanging;
    4322    
    4323     public event PropertyChangedEventHandler PropertyChanged;
    4324    
    4325     protected virtual void SendPropertyChanging()
    4326     {
    4327       if ((this.PropertyChanging != null))
    4328       {
    4329         this.PropertyChanging(this, emptyChangingEventArgs);
    4330       }
    4331     }
    4332    
    4333     protected virtual void SendPropertyChanged(String propertyName)
    4334     {
    4335       if ((this.PropertyChanged != null))
    4336       {
    4337         this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
    4338       }
    4339     }
    4340    
    4341     private void attach_UserStatistics(UserStatistics entity)
    4342     {
    4343       this.SendPropertyChanging();
    4344       entity.Statistics = this;
    4345     }
    4346    
    4347     private void detach_UserStatistics(UserStatistics entity)
    4348     {
    4349       this.SendPropertyChanging();
    4350       entity.Statistics = null;
    4351     }
    4352    
    4353     private void attach_SlaveStatistics(SlaveStatistics entity)
    4354     {
    4355       this.SendPropertyChanging();
    4356       entity.Statistics = this;
    4357     }
    4358    
    4359     private void detach_SlaveStatistics(SlaveStatistics entity)
    4360     {
    4361       this.SendPropertyChanging();
    4362       entity.Statistics = null;
    43633549    }
    43643550  }
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive.DataAccess/3.3/SQL Scripts/Initialize Hive Database.sql

    r12584 r12768  
    131131  [DateEnqueued] DateTime NOT NULL,
    132132  CONSTRAINT [PK_UserPriority] PRIMARY KEY ([UserId])
    133   )
    134 CREATE TABLE [DeletedJobStatistics](
    135   [UserId] UniqueIdentifier NOT NULL,
    136   [ExecutionTimeS] float NOT NULL,
    137   [ExecutionTimeSFinishedJobs] float NOT NULL,
    138   [StartToEndTimeS] float NOT NULL,
    139   [DeletedJobStatisticsId] UniqueIdentifier NOT NULL,
    140   CONSTRAINT [PK_DeletedJobStatistics] PRIMARY KEY ([DeletedJobStatisticsId])
    141   )
    142 CREATE TABLE [UserStatistics](
    143   [StatisticsId] UniqueIdentifier NOT NULL,
    144   [UserId] UniqueIdentifier NOT NULL,
    145   [ExecutionTimeMs] float NOT NULL,
    146   [UsedCores] Int NOT NULL,
    147   [ExecutionTimeMsFinishedJobs] float NOT NULL,
    148   [StartToEndTimeMs] float NOT NULL,
    149   CONSTRAINT [PK_UserStatistics] PRIMARY KEY ([StatisticsId], [UserId])
    150   )
    151 CREATE TABLE [SlaveStatistics](
    152   [StatisticsId] UniqueIdentifier NOT NULL,
    153   [SlaveId] UniqueIdentifier NOT NULL,
    154   [Cores] Int NOT NULL,
    155   [FreeCores] Int NOT NULL,
    156   [CpuUtilization] float NOT NULL,
    157   [Memory] Int NOT NULL,
    158   [FreeMemory] Int NOT NULL,
    159   CONSTRAINT [PK_SlaveStatistics] PRIMARY KEY ([StatisticsId], [SlaveId])
    160   )
    161 CREATE TABLE [Statistics](
    162   [StatisticsId] UniqueIdentifier NOT NULL,
    163   [Timestamp] DateTime NOT NULL,
    164   CONSTRAINT [PK_Statistics] PRIMARY KEY ([StatisticsId])
    165133  )
    166134ALTER TABLE [dbo].[AssignedResources]
     
    192160ALTER TABLE [dbo].[JobPermission]
    193161  ADD CONSTRAINT [Job_JobPermission] FOREIGN KEY ([JobId]) REFERENCES [dbo].[Job]([JobId])
    194 ALTER TABLE [UserStatistics]
    195   ADD CONSTRAINT [Statistics_UserStatistics] FOREIGN KEY ([StatisticsId]) REFERENCES [Statistics]([StatisticsId])
    196 ALTER TABLE [SlaveStatistics]
    197   ADD CONSTRAINT [Statistics_SlaveStatistics] FOREIGN KEY ([StatisticsId]) REFERENCES [Statistics]([StatisticsId])
    198162
    199163GO
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive.DataAccess/3.3/SQL Scripts/Prepare Hive Database.sql

    r12761 r12768  
    9393GO
    9494
    95 ALTER TABLE [dbo].[Statistics] ALTER COLUMN StatisticsId ADD ROWGUIDCOL;
    96 ALTER TABLE [dbo].[Statistics] WITH NOCHECK ADD CONSTRAINT [DF_Statistics_StatisticsId] DEFAULT (NEWSEQUENTIALID()) FOR StatisticsId;
    97 GO
    98 
    99 ALTER TABLE [dbo].[DeletedJobStatistics] ALTER COLUMN DeletedJobStatisticsId ADD ROWGUIDCOL;
    100 ALTER TABLE [dbo].[DeletedJobStatistics] WITH NOCHECK ADD CONSTRAINT [DF_DeletedJobStatistics_DeletedJobStatisticsId] DEFAULT (NEWSEQUENTIALID()) FOR DeletedJobStatisticsId;
    101 GO
    102 
    103 ALTER TABLE [dbo].[SlaveStatistics]  DROP  CONSTRAINT [Statistics_SlaveStatistics]
    104 ALTER TABLE [dbo].[SlaveStatistics]  WITH CHECK ADD  CONSTRAINT [Statistics_SlaveStatistics] FOREIGN KEY([StatisticsId])
    105 REFERENCES [dbo].[Statistics] ([StatisticsId])
    106 ON UPDATE CASCADE
    107 ON DELETE CASCADE
    108 GO
    109 
    110 ALTER TABLE [dbo].[UserStatistics]  DROP  CONSTRAINT [Statistics_UserStatistics]
    111 ALTER TABLE [dbo].[UserStatistics]  WITH CHECK ADD  CONSTRAINT [Statistics_UserStatistics] FOREIGN KEY([StatisticsId])
    112 REFERENCES [dbo].[Statistics] ([StatisticsId])
    113 ON UPDATE CASCADE
    114 ON DELETE CASCADE
    115 GO
    116 
    11795/* create indices */
    11896CREATE INDEX Index_RequiredPlugins_TaskId ON RequiredPlugins(TaskId);
     
    147125GO
    148126
    149 -- =============================================
    150 -- Author:    cneumuel
    151 -- Description: returns aggregates statistic information for every minute
    152 -- =============================================
    153 CREATE VIEW [dbo].[view_Statistics]
    154 AS
    155 SELECT  CONVERT(VARCHAR(19), MIN(s.Timestamp), 120) AS DateTime, SUM(ss.Cores) AS Cores, SUM(ss.FreeCores) AS FreeCores,
    156         AVG(ss.CpuUtilization) AS CpuUtilization, SUM(ss.Memory) AS Memory, SUM(ss.FreeMemory) AS FreeMemory, x.exSum AS ExecutionTimeHours,
    157         x.exFinishedSum AS ExecutionTimeFinished, x.exStartToEndSum AS StartToEndTimeFinished
    158 FROM         dbo.SlaveStatistics AS ss INNER JOIN
    159                       dbo.[Statistics] AS s ON ss.StatisticsId = s.StatisticsId INNER JOIN
    160                       dbo.Resource AS r ON ss.SlaveId = r.ResourceId INNER JOIN
    161                           (SELECT     StatisticsId, SUM(ExecutionTimeMs) / 1000 / 60 / 60 AS exSum, SUM(ExecutionTimeMsFinishedJobs) / 1000 / 60 / 60 AS exFinishedSum,
    162                                                    SUM(StartToEndTimeMs) / 1000 / 60 / 60 AS exStartToEndSum
    163                             FROM          dbo.UserStatistics AS us
    164                             GROUP BY StatisticsId) AS x ON s.StatisticsId = x.StatisticsId
    165 GROUP BY s.StatisticsId, x.exSum, x.exFinishedSum, x.exStartToEndSum
    166 
    167 /* triggers */
    168 GO
    169127/****** Object:  Trigger [dbo].[tr_JobDeleteCascade]    Script Date: 04/19/2011 16:31:53 ******/
    170128SET ANSI_NULLS ON
     
    191149-- Create date: 11.11.2010
    192150-- Description: Recursively deletes all child-jobs of a job when it is deleted. (Source: http://devio.wordpress.com/2008/05/23/recursive-delete-in-sql-server/)
    193 -- =============================================
     151-- =============================================DeletedJobStatistics
    194152CREATE TRIGGER [dbo].[tr_TaskDeleteCascade] ON [dbo].[Task] INSTEAD OF DELETE AS
    195153BEGIN
    196     -- add statistics
    197     INSERT INTO dbo.DeletedJobStatistics (UserId, ExecutionTimeS, ExecutionTimeSFinishedJobs, StartToEndTimeS)
    198154    SELECT
    199155        he.OwnerUserId AS UserId,
     
    238194GO
    239195
    240 
    241 CREATE TRIGGER [dbo].[tr_StatisticsDeleteCascade] ON [dbo].[Statistics] INSTEAD OF DELETE AS
    242 BEGIN
    243     DELETE SlaveStatistics FROM deleted, SlaveStatistics WHERE deleted.StatisticsId = SlaveStatistics.StatisticsId
    244     -- should also remove UserStatistics here
    245     DELETE [Statistics] FROM deleted, [Statistics] WHERE deleted.StatisticsId = [Statistics].StatisticsId
    246 END
    247 GO
    248 
    249 
    250196-- ============================================================
    251197-- Description: Create indices to speed up execution of queries
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/Convert.cs

    r12584 r12768  
    323323    }
    324324    #endregion
    325 
    326     #region SlaveStatistics
    327     public static DT.SlaveStatistics ToDto(DB.SlaveStatistics source) {
    328       if (source == null) return null;
    329       return new DT.SlaveStatistics {
    330         Id = source.StatisticsId,
    331         SlaveId = source.SlaveId,
    332         Cores = source.Cores,
    333         CpuUtilization = source.CpuUtilization,
    334         FreeCores = source.FreeCores,
    335         FreeMemory = source.FreeMemory,
    336         Memory = source.Memory
    337       };
    338     }
    339     public static DB.SlaveStatistics ToEntity(DT.SlaveStatistics source) {
    340       if (source == null) return null;
    341       var entity = new DB.SlaveStatistics(); ToEntity(source, entity);
    342       return entity;
    343     }
    344     public static void ToEntity(DT.SlaveStatistics source, DB.SlaveStatistics target) {
    345       if ((source != null) && (target != null)) {
    346         target.StatisticsId = source.Id;
    347         target.SlaveId = source.SlaveId;
    348         target.Cores = source.Cores;
    349         target.CpuUtilization = source.CpuUtilization;
    350         target.FreeCores = source.FreeCores;
    351         target.FreeMemory = source.FreeMemory;
    352         target.Memory = source.Memory;
    353       }
    354     }
    355     #endregion
    356 
    357     #region Statistics
    358     public static DT.Statistics ToDto(DB.Statistics source) {
    359       if (source == null) return null;
    360       return new DT.Statistics {
    361         Id = source.StatisticsId,
    362         TimeStamp = source.Timestamp,
    363         SlaveStatistics = source.SlaveStatistics.Select(x => Convert.ToDto(x)).ToArray(),
    364         UserStatistics = source.UserStatistics.Select(x => Convert.ToDto(x)).ToArray()
    365       };
    366     }
    367     public static DB.Statistics ToEntity(DT.Statistics source) {
    368       if (source == null) return null;
    369       var entity = new DB.Statistics(); ToEntity(source, entity);
    370       return entity;
    371     }
    372     public static void ToEntity(DT.Statistics source, DB.Statistics target) {
    373       if ((source != null) && (target != null)) {
    374         target.StatisticsId = source.Id;
    375         target.Timestamp = source.TimeStamp;
    376 
    377       }
    378     }
    379     #endregion
    380 
    381     #region UserStatistics
    382     public static DT.UserStatistics ToDto(DB.UserStatistics source) {
    383       if (source == null) return null;
    384       return new DT.UserStatistics {
    385         Id = source.StatisticsId,
    386         UserId = source.UserId,
    387         UsedCores = source.UsedCores,
    388         ExecutionTime = TimeSpan.FromMilliseconds(source.ExecutionTimeMs),
    389         ExecutionTimeFinishedJobs = TimeSpan.FromMilliseconds(source.ExecutionTimeMsFinishedJobs),
    390         StartToEndTime = TimeSpan.FromMilliseconds(source.StartToEndTimeMs)
    391       };
    392     }
    393     public static DB.UserStatistics ToEntity(DT.UserStatistics source) {
    394       if (source == null) return null;
    395       var entity = new DB.UserStatistics(); ToEntity(source, entity);
    396       return entity;
    397     }
    398     public static void ToEntity(DT.UserStatistics source, DB.UserStatistics target) {
    399       if ((source != null) && (target != null)) {
    400         target.StatisticsId = source.Id;
    401         target.UserId = source.UserId;
    402         target.UsedCores = source.UsedCores;
    403         target.ExecutionTimeMs = source.ExecutionTime.TotalMilliseconds;
    404         target.ExecutionTimeMsFinishedJobs = source.ExecutionTimeFinishedJobs.TotalMilliseconds;
    405         target.StartToEndTimeMs = source.StartToEndTime.TotalMilliseconds;
    406       }
    407     }
    408     #endregion
    409 
    410325    #region TaskData
    411326    public static DT.TaskState ToDto(DB.TaskState source) {
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/HeuristicLab.Services.Hive-3.3.csproj

    r12765 r12768  
    140140    <Compile Include="DataTransfer\SlaveGroup.cs" />
    141141    <Compile Include="DataTransfer\SlaveState.cs" />
    142     <Compile Include="DataTransfer\SlaveStatistics.cs" />
    143142    <Compile Include="DataTransfer\StateLog.cs" />
    144     <Compile Include="DataTransfer\Statistics.cs" />
    145     <Compile Include="DataTransfer\UserStatistics.cs" />
    146143    <Compile Include="HiveStatisticsGenerator.cs" />
    147144    <Compile Include="Interfaces\IStatisticsGenerator.cs" />
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/HiveDao.cs

    r12584 r12768  
    827827    #endregion
    828828
    829     #region Statistics Methods
    830     public DT.Statistics GetStatistic(Guid id) {
    831       using (var db = CreateContext()) {
    832         return DT.Convert.ToDto(db.Statistics.SingleOrDefault(x => x.StatisticsId == id));
    833       }
    834     }
    835 
    836     public IEnumerable<DT.Statistics> GetStatistics(Expression<Func<Statistics, bool>> predicate) {
    837       using (var db = CreateContext()) {
    838         return db.Statistics.Where(predicate).Select(x => DT.Convert.ToDto(x)).ToArray();
    839       }
    840     }
    841 
    842     public Guid AddStatistics(DT.Statistics dto) {
    843       using (var db = CreateContext()) {
    844         var entity = DT.Convert.ToEntity(dto);
    845         db.Statistics.InsertOnSubmit(entity);
    846         db.SubmitChanges();
    847         foreach (var slaveStat in dto.SlaveStatistics) {
    848           slaveStat.Id = entity.StatisticsId;
    849           db.SlaveStatistics.InsertOnSubmit(DT.Convert.ToEntity(slaveStat));
    850         }
    851         if (dto.UserStatistics != null) {
    852           foreach (var userStat in dto.UserStatistics) {
    853             userStat.Id = entity.StatisticsId;
    854             db.UserStatistics.InsertOnSubmit(DT.Convert.ToEntity(userStat));
    855           }
    856         }
    857         db.SubmitChanges();
    858         return entity.StatisticsId;
    859       }
    860     }
    861 
    862     public void DeleteStatistics(Guid id) {
    863       using (var db = CreateContext()) {
    864         var entity = db.Statistics.FirstOrDefault(x => x.StatisticsId == id);
    865         if (entity != null) db.Statistics.DeleteOnSubmit(entity);
    866         db.SubmitChanges();
    867       }
    868     }
    869 
    870     public Dictionary<Guid, int> GetWaitingTasksByUserForResources(List<Guid> resourceIds) {
    871       using (var db = CreateContext()) {
    872         var waitingTasksByUser = from task in db.Tasks
    873                                  where task.State == TaskState.Waiting && task.AssignedResources.Any(x => resourceIds.Contains(x.ResourceId))
    874                                  group task by task.Job.OwnerUserId into g
    875                                  select new { UserId = g.Key, UsedCores = g.Count() };
    876         return waitingTasksByUser.ToDictionary(x => x.UserId, x => x.UsedCores);
    877       }
    878     }
    879 
    880     public Dictionary<Guid, int> GetCalculatingTasksByUserForResources(List<Guid> resourceIds) {
    881       using (var db = CreateContext()) {
    882         var calculatingTasksByUser = from task in db.Tasks
    883                                      where task.State == TaskState.Calculating && task.AssignedResources.Any(x => resourceIds.Contains(x.ResourceId))
    884                                      group task by task.Job.OwnerUserId into g
    885                                      select new { UserId = g.Key, UsedCores = g.Count() };
    886         return calculatingTasksByUser.ToDictionary(x => x.UserId, x => x.UsedCores);
    887       }
    888     }
    889 
    890     public List<DT.UserStatistics> GetUserStatistics() {
    891       using (var db = CreateContext()) {
    892         var userStats = new Dictionary<Guid, DT.UserStatistics>();
    893 
    894         var usedCoresByUser = from job in db.Tasks
    895                               where job.State == TaskState.Calculating
    896                               group job by job.Job.OwnerUserId into g
    897                               select new { UserId = g.Key, UsedCores = g.Count() };
    898 
    899         foreach (var item in usedCoresByUser) {
    900           if (!userStats.ContainsKey(item.UserId)) {
    901             userStats.Add(item.UserId, new DT.UserStatistics() { UserId = item.UserId });
    902           }
    903           userStats[item.UserId].UsedCores += item.UsedCores;
    904         }
    905 
    906         var executionTimesByUser = from task in db.Tasks
    907                                    group task by task.Job.OwnerUserId into g
    908                                    select new { UserId = g.Key, ExecutionTime = TimeSpan.FromMilliseconds(g.Select(x => x.ExecutionTimeMs).Sum()) };
    909         foreach (var item in executionTimesByUser) {
    910           if (!userStats.ContainsKey(item.UserId)) {
    911             userStats.Add(item.UserId, new DT.UserStatistics() { UserId = item.UserId });
    912           }
    913           userStats[item.UserId].ExecutionTime += item.ExecutionTime;
    914         }
    915 
    916         // execution times only of finished task - necessary to compute efficieny
    917         var executionTimesFinishedJobs = from job in db.Tasks
    918                                          where job.State == TaskState.Finished
    919                                          group job by job.Job.OwnerUserId into g
    920                                          select new { UserId = g.Key, ExecutionTimeFinishedJobs = TimeSpan.FromMilliseconds(g.Select(x => x.ExecutionTimeMs).Sum()) };
    921 
    922         foreach (var item in executionTimesFinishedJobs) {
    923           if (!userStats.ContainsKey(item.UserId)) {
    924             userStats.Add(item.UserId, new DT.UserStatistics() { UserId = item.UserId });
    925           }
    926           userStats[item.UserId].ExecutionTimeFinishedJobs += item.ExecutionTimeFinishedJobs;
    927         }
    928 
    929         // start to end times only of finished task - necessary to compute efficiency
    930         var startToEndTimesFinishedJobs = from job in db.Tasks
    931                                           where job.State == TaskState.Finished
    932                                           group job by job.Job.OwnerUserId into g
    933                                           select new {
    934                                             UserId = g.Key,
    935                                             StartToEndTime = new TimeSpan(g.Select(x => x.StateLogs.OrderByDescending(sl => sl.DateTime).First().DateTime - x.StateLogs.OrderBy(sl => sl.DateTime).First().DateTime).Sum(ts => ts.Ticks))
    936                                           };
    937         foreach (var item in startToEndTimesFinishedJobs) {
    938           if (!userStats.ContainsKey(item.UserId)) {
    939             userStats.Add(item.UserId, new DT.UserStatistics() { UserId = item.UserId });
    940           }
    941           userStats[item.UserId].StartToEndTime += item.StartToEndTime;
    942         }
    943 
    944         // also consider executiontimes of DeletedJobStats
    945         var deletedJobsExecutionTimesByUsers = from del in db.DeletedJobStatistics
    946                                                group del by del.UserId into g
    947                                                select new {
    948                                                  UserId = g.Key,
    949                                                  ExecutionTime = TimeSpan.FromSeconds(g.Select(x => x.ExecutionTimeS).Sum()),
    950                                                  ExecutionTimeFinishedJobs = TimeSpan.FromSeconds(g.Select(x => x.ExecutionTimeSFinishedJobs).Sum()),
    951                                                  StartToEndTime = TimeSpan.FromSeconds(g.Select(x => x.StartToEndTimeS).Sum())
    952                                                };
    953         foreach (var item in deletedJobsExecutionTimesByUsers) {
    954           if (!userStats.ContainsKey(item.UserId)) {
    955             userStats.Add(item.UserId, new DT.UserStatistics() { UserId = item.UserId });
    956           }
    957           userStats[item.UserId].ExecutionTime += item.ExecutionTime;
    958           userStats[item.UserId].ExecutionTimeFinishedJobs += item.ExecutionTimeFinishedJobs;
    959           userStats[item.UserId].StartToEndTime += item.StartToEndTime;
    960         }
    961 
    962         return userStats.Values.ToList();
    963       }
    964     }
    965     #endregion
    966 
    967829    #region UserPriority Methods
    968830    public IEnumerable<DT.UserPriority> GetUserPriorities(Expression<Func<UserPriority, bool>> predicate) {
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/HiveService.cs

    r12691 r12768  
    788788    }
    789789    #endregion
    790 
    791     #region Statistics Methods
    792     public IEnumerable<Statistics> GetStatistics() {
    793       return trans.UseTransaction(() => { return dao.GetStatistics(x => true); });
    794     }
    795     public IEnumerable<Statistics> GetStatisticsForTimePeriod(DateTime from, DateTime to) {
    796       return trans.UseTransaction(() => { return dao.GetStatistics(x => x.Timestamp >= from && x.Timestamp <= to); });
    797     }
    798     #endregion
    799790  }
    800791}
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/Interfaces/IHiveDao.cs

    r12146 r12768  
    149149    #endregion
    150150
    151     #region Statistics Methods
    152     Dictionary<Guid, int> GetWaitingTasksByUserForResources(List<Guid> resourceIds);
    153     Dictionary<Guid, int> GetCalculatingTasksByUserForResources(List<Guid> resourceIds);
    154     DT.Statistics GetStatistic(Guid id);
    155     IEnumerable<DT.Statistics> GetStatistics(Expression<Func<Statistics, bool>> predicate);
    156     Guid AddStatistics(DT.Statistics dto);
    157     void DeleteStatistics(Guid id);
    158     List<DT.UserStatistics> GetUserStatistics();
    159     #endregion
    160 
    161151    #region UserPriority Methods
    162152    IEnumerable<DT.UserPriority> GetUserPriorities(Expression<Func<UserPriority, bool>> predicate);
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/Manager/EventManager.cs

    r12468 r12768  
    2121
    2222using System;
    23 using System.Collections.Generic;
    2423using System.Linq;
    2524using HeuristicLab.Services.Hive.DataAccess;
     
    5554      trans.UseTransaction(() => {
    5655        FinishParentTasks();
    57         UpdateStatistics();
    5856      });
    59     }
    60 
    61     private void UpdateStatistics() {
    62       var slaves = dao.GetSlaves(x => x.SlaveState == SlaveState.Calculating || x.SlaveState == SlaveState.Idle);
    63 
    64       var stats = new DataTransfer.Statistics();
    65       stats.TimeStamp = DateTime.Now;
    66       var slaveStats = new List<DT.SlaveStatistics>();
    67       foreach (var slave in slaves) {
    68         slaveStats.Add(new DT.SlaveStatistics() {
    69           SlaveId = slave.Id,
    70           Cores = slave.Cores.HasValue ? slave.Cores.Value : 0,
    71           FreeCores = slave.FreeCores.HasValue ? slave.FreeCores.Value : 0,
    72           Memory = slave.Memory.HasValue ? slave.Memory.Value : 0,
    73           FreeMemory = slave.FreeMemory.HasValue ? slave.FreeMemory.Value : 0,
    74           CpuUtilization = slave.CpuUtilization
    75         });
    76       }
    77       stats.SlaveStatistics = slaveStats;
    78       //collecting user statistics slows down the db and results in timeouts.
    79       //we have to find another way to deal with this. 
    80       //until then the next line is commented out...
    81       //stats.UserStatistics = dtoDao.GetUserStatistics();
    82       dao.AddStatistics(stats);
    8357    }
    8458
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/NewHiveService.cs

    r12691 r12768  
    10071007    #endregion
    10081008
    1009     #region Statistics Methods
    1010     public IEnumerable<Statistics> GetStatistics() {
    1011       // unused
    1012       throw new NotImplementedException();
    1013     }
    1014 
    1015     public IEnumerable<Statistics> GetStatisticsForTimePeriod(DateTime @from, DateTime to) {
    1016       // unused
    1017       throw new NotImplementedException();
    1018     }
    1019     #endregion
    1020 
    10211009    #region Private Helper Methods
    10221010    private void UpdateTaskState(IPersistenceManager pm, DA.Task task, DT.TaskState taskState, Guid? slaveId, Guid? userId, string exception) {
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/ServiceContracts/IHiveService.cs

    r12761 r12768  
    252252    IEnumerable<UserPriority> GetUserPriorities();
    253253    #endregion
    254 
    255     #region Statistics Methods
    256     [OperationContract]
    257     IEnumerable<Statistics> GetStatistics();
    258     [OperationContract]
    259     IEnumerable<Statistics> GetStatisticsForTimePeriod(DateTime from, DateTime to);
    260     #endregion
    261254  }
    262255}
  • branches/HiveStatistics/sources/HeuristicLab.Services.WebApp.Statistics/3.3/WebApi/TaskController.cs

    r12584 r12768  
    3535
    3636namespace HeuristicLab.Services.WebApp.Statistics.WebApi {
     37  [Authorize]
    3738  public class TaskController : ApiController {
    3839    private IPersistenceManager PersistenceManager {
  • branches/HiveStatistics/sources/HeuristicLab.Services.WebApp.Statistics/3.3/WebApp/clients/details/clientDetails.cshtml

    r12584 r12768  
    181181</div>
    182182
     183<div class="default-filter-header text-center">
     184    <form class="form-inline">
     185        <div class="form-group" style="margin-left: 5px; margin-right: 5px;">
     186            <label for="fromDate">From:&nbsp;</label>
     187            <div class="input-group">
     188                <input id="fromDate" type="text" class="form-control" datepicker-popup="dd.MM.yyyy" ng-model="fromDate" is-open="fromIsOpen" datepicker-options="dateOptions" ng-required="true" close-text="Close" />
     189                <span class="input-group-btn">
     190                    <button type="button" class="btn btn-default" ng-click="openFromDateSelection($event)"><i class="glyphicon glyphicon-calendar"></i></button>
     191                </span>
     192            </div>
     193        </div>
     194        <div class="form-group" style="margin-left: 5px; margin-right: 5px;">
     195            <label for="fromDate">To:&nbsp;</label>
     196            <div class="input-group">
     197                <input id="fromDate" type="text" class="form-control" datepicker-popup="dd.MM.yyyy" ng-model="toDate" is-open="toIsOpen" datepicker-options="dateOptions" ng-required="true" close-text="Close" />
     198                <span class="input-group-btn">
     199                    <button type="button" class="btn btn-default" ng-click="openToDateSelection($event)"><i class="glyphicon glyphicon-calendar"></i></button>
     200                </span>
     201            </div>
     202        </div>
     203        <div class="form-group" style="margin-left: 5px; margin-right: 5px;">
     204            <button type="button" class="btn btn-default" ng-click="updateCharts()">
     205                Apply
     206            </button>
     207        </div>
     208    </form>
     209</div>
     210
     211<div class="default-view-container">
     212    <div class="row">
     213        <div class="col-lg-12">
     214            <div class="panel panel-default">
     215                <div class="panel-heading">
     216                    <h3 class="panel-title">CPU Utilization Chart</h3>
     217                </div>
     218                <div class="panel-body">
     219                    <flot dataset="cpuSeries" options="chartOptions"></flot>
     220                </div>
     221            </div>
     222        </div>
     223    </div>
     224
     225    <div class="row">
     226        <div class="col-lg-12">
     227            <div class="panel panel-default">
     228                <div class="panel-heading">
     229                    <h3 class="panel-title">Core Chart</h3>
     230                </div>
     231                <div class="panel-body">
     232                    <flot dataset="coreSeries" options="fillChartOptions"></flot>
     233                </div>
     234            </div>
     235        </div>
     236    </div>
     237
     238    <div class="row">
     239        <div class="col-lg-12">
     240            <div class="panel panel-default">
     241                <div class="panel-heading">
     242                    <h3 class="panel-title">Memory Chart</h3>
     243                </div>
     244                <div class="panel-body">
     245                    <flot dataset="memorySeries" options="fillChartOptions"></flot>
     246                </div>
     247            </div>
     248        </div>
     249    </div>
     250</div>
     251
    183252<div id="tasks-filter" class="default-filter-header text-center">
    184253    <form class="form-inline">
     
    212281</div>
    213282
    214  <div class="default-view-container">
    215      <div id="taskListContainer" class="row" ng-show="taskPage.Tasks.length">
    216          <div class="col-lg-4 col-md-4" ng-repeat="task in taskPage.Tasks">
    217              <div class="panel panel-default">
    218                  @if (Request.IsAuthenticated && User.IsInRole(HiveRoles.Administrator)) {
    219                     <div class="panel-heading cursor-pointer" ng-click="openDialog(($index + 1)+((curTaskPage-1)*(taskPageSize)), task)">
    220                         <h3 class="panel-title" style="display: inline">Task {{($index + 1)+((curTaskPage-1)*(taskPageSize))}}</h3>
    221                         <span ng-if="task.State == 'Finished'" class="label label-success" style="float: right;">{{task.State}}</span>
    222                         <span ng-if="task.State == 'Aborted' || task.State == 'Failed'" class="label label-danger" style="float: right;">{{task.State}}</span>
    223                         <span ng-if="task.State == 'Waiting'" class="label label-warning" style="float: right;">{{task.State}}</span>
    224                         <span ng-if="task.State != 'Waiting' && task.State != 'Failed' && task.State != 'Aborted' && task.State != 'Finished'" class="label label-default" style="float: right;">{{task.State}}</span>
    225                     </div>
    226                  } else {
    227                     <div class="panel-heading">
    228                         <h3 class="panel-title" style="display: inline">Task {{($index + 1)+((curTaskPage-1)*(taskPageSize))}}</h3>
    229                         <span ng-if="task.State == 'Finished'" class="label label-success" style="float: right;">{{task.State}}</span>
    230                         <span ng-if="task.State == 'Aborted' || task.State == 'Failed'" class="label label-danger" style="float: right;">{{task.State}}</span>
    231                         <span ng-if="task.State == 'Waiting'" class="label label-warning" style="float: right;">{{task.State}}</span>
    232                         <span ng-if="task.State != 'Waiting' && task.State != 'Failed' && task.State != 'Aborted' && task.State != 'Finished'" class="label label-default" style="float: right;">{{task.State}}</span>
    233                     </div>
    234                  }
    235                  
    236                  <div class="panel-body">
    237                      <table class="table table-condensed table-no-border table-auto-width">
    238                          @if (Request.IsAuthenticated && User.IsInRole(HiveRoles.Administrator)) {
    239                              <tr>
    240                                  <td colspan="2"><span data-fittext="0.99">{{task.Id}}</span></td>
    241                              </tr>
    242                          }
    243                         <tr>
    244                             <td>Start Time:</td>
    245                             <td ng-show="task.StartTime" class="text-right">{{task.StartTime | toDate}}</td>
    246                             <td ng-hide="task.StartTime" class="text-right">Not started</td>
    247                         </tr>
    248                         <tr>
    249                             <td>End Time:</td>
    250                             <td ng-show="task.EndTime" class="text-right">{{task.EndTime | toDate}}</td>
    251                             <td ng-hide="task.EndTime" class="text-right">Not finished</td>
    252                         </tr>
    253                          <tr>
    254                              <td>Calculating Time:</td>
    255                              <td class="text-right">{{task.CalculatingTime | toTimespan}}</td>
    256                          </tr>
    257                          @if (Request.IsAuthenticated && User.IsInRole(HiveRoles.Administrator)) {
    258                              <tr>
    259                                  <td>User:</td>
    260                                  <td class="text-right">
    261                                      <a ng-href="#/statistics/users/{{task.UserId}}" ng-show="task.UserName">{{task.UserName}}</a>
    262                                      <span ng-hide="task.UserName">Unknown</span>
    263                                  </td>
    264                              </tr>
    265                              <tr>
    266                                  <td>Job:</td>
    267                                  <td class="text-right">
    268                                      <a ng-href="#/statistics/jobs/{{task.JobId}}" ng-show="task.JobName">{{task.JobName}}</a>
    269                                      <span ng-hide="task.JobName">Unknown</span>
    270                                  </td>
    271                              </tr>
    272                          }
    273                      </table>
    274                  </div>
    275 
    276              </div>
    277          </div>
    278      </div>
    279      <div ng-hide="taskPage.Tasks.length">
    280          <p class="text-center">Please select at least one state!</p>
    281      </div>
    282      <div class="row text-center" ng-show="taskPage.TotalTasks > taskPage.Tasks.length">
    283          <pagination max-size="10" total-items="taskPage.TotalTasks" ng-model="curTaskPage" ng-change="changeTaskPage()" items-per-page="taskPageSize"
    284                      boundary-links="true" rotate="false" num-pages="numPages"></pagination>
    285      </div>
    286  </div>
    287 
    288  <div class="default-filter-header text-center">
    289      <form class="form-inline">
    290          <div class="form-group" style="margin-left: 5px; margin-right: 5px;">
    291              <label for="fromDate">From:&nbsp;</label>
    292              <div class="input-group">
    293                  <input id="fromDate" type="text" class="form-control" datepicker-popup="dd.MM.yyyy" ng-model="fromDate" is-open="fromIsOpen" datepicker-options="dateOptions" ng-required="true" close-text="Close" />
    294                  <span class="input-group-btn">
    295                      <button type="button" class="btn btn-default" ng-click="openFromDateSelection($event)"><i class="glyphicon glyphicon-calendar"></i></button>
    296                  </span>
    297              </div>
    298          </div>
    299          <div class="form-group" style="margin-left: 5px; margin-right: 5px;">
    300              <label for="fromDate">To:&nbsp;</label>
    301              <div class="input-group">
    302                  <input id="fromDate" type="text" class="form-control" datepicker-popup="dd.MM.yyyy" ng-model="toDate" is-open="toIsOpen" datepicker-options="dateOptions" ng-required="true" close-text="Close" />
    303                  <span class="input-group-btn">
    304                      <button type="button" class="btn btn-default" ng-click="openToDateSelection($event)"><i class="glyphicon glyphicon-calendar"></i></button>
    305                  </span>
    306              </div>
    307          </div>
    308          <div class="form-group" style="margin-left: 5px; margin-right: 5px;">
    309              <button type="button" class="btn btn-default" ng-click="updateCharts()">
    310                  Apply
    311              </button>
    312          </div>
    313      </form>
    314  </div>
    315 
    316  <div class="default-view-container">
    317      <div class="row">
    318          <div class="col-lg-12">
    319              <div class="panel panel-default">
    320                  <div class="panel-heading">
    321                      <h3 class="panel-title">CPU Utilization Chart</h3>
    322                  </div>
    323                  <div class="panel-body">
    324                      <flot dataset="cpuSeries" options="chartOptions"></flot>
    325                  </div>
    326              </div>
    327          </div>
    328      </div>
    329 
    330      <div class="row">
    331          <div class="col-lg-12">
    332              <div class="panel panel-default">
    333                  <div class="panel-heading">
    334                      <h3 class="panel-title">Core Chart</h3>
    335                  </div>
    336                  <div class="panel-body">
    337                      <flot dataset="coreSeries" options="fillChartOptions"></flot>
    338                  </div>
    339              </div>
    340          </div>
    341      </div>
    342 
    343      <div class="row">
    344          <div class="col-lg-12">
    345              <div class="panel panel-default">
    346                  <div class="panel-heading">
    347                      <h3 class="panel-title">Memory Chart</h3>
    348                  </div>
    349                  <div class="panel-body">
    350                      <flot dataset="memorySeries" options="fillChartOptions"></flot>
    351                  </div>
    352              </div>
    353          </div>
    354      </div>
    355  </div>
     283<div class="default-view-container">
     284    <div id="taskListContainer" class="row" ng-show="taskPage.Tasks.length">
     285        <div class="col-lg-4 col-md-4" ng-repeat="task in taskPage.Tasks">
     286            <div class="panel panel-default">
     287                @if (Request.IsAuthenticated && User.IsInRole(HiveRoles.Administrator)) {
     288                   <div class="panel-heading cursor-pointer" ng-click="openDialog(($index + 1)+((curTaskPage-1)*(taskPageSize)), task)">
     289                       <h3 class="panel-title" style="display: inline">Task {{($index + 1)+((curTaskPage-1)*(taskPageSize))}}</h3>
     290                       <span ng-if="task.State == 'Finished'" class="label label-success" style="float: right;">{{task.State}}</span>
     291                       <span ng-if="task.State == 'Aborted' || task.State == 'Failed'" class="label label-danger" style="float: right;">{{task.State}}</span>
     292                       <span ng-if="task.State == 'Waiting'" class="label label-warning" style="float: right;">{{task.State}}</span>
     293                       <span ng-if="task.State != 'Waiting' && task.State != 'Failed' && task.State != 'Aborted' && task.State != 'Finished'" class="label label-default" style="float: right;">{{task.State}}</span>
     294                   </div>
     295                } else {
     296                   <div class="panel-heading">
     297                       <h3 class="panel-title" style="display: inline">Task {{($index + 1)+((curTaskPage-1)*(taskPageSize))}}</h3>
     298                       <span ng-if="task.State == 'Finished'" class="label label-success" style="float: right;">{{task.State}}</span>
     299                       <span ng-if="task.State == 'Aborted' || task.State == 'Failed'" class="label label-danger" style="float: right;">{{task.State}}</span>
     300                       <span ng-if="task.State == 'Waiting'" class="label label-warning" style="float: right;">{{task.State}}</span>
     301                       <span ng-if="task.State != 'Waiting' && task.State != 'Failed' && task.State != 'Aborted' && task.State != 'Finished'" class="label label-default" style="float: right;">{{task.State}}</span>
     302                   </div>
     303                }
     304               
     305                <div class="panel-body">
     306                    <table class="table table-condensed table-no-border table-auto-width">
     307                        @if (Request.IsAuthenticated && User.IsInRole(HiveRoles.Administrator)) {
     308                            <tr>
     309                                <td colspan="2"><span data-fittext="0.99">{{task.Id}}</span></td>
     310                            </tr>
     311                        }
     312                       <tr>
     313                           <td>Start Time:</td>
     314                           <td ng-show="task.StartTime" class="text-right">{{task.StartTime | toDate}}</td>
     315                           <td ng-hide="task.StartTime" class="text-right">Not started</td>
     316                       </tr>
     317                       <tr>
     318                           <td>End Time:</td>
     319                           <td ng-show="task.EndTime" class="text-right">{{task.EndTime | toDate}}</td>
     320                           <td ng-hide="task.EndTime" class="text-right">Not finished</td>
     321                       </tr>
     322                        <tr>
     323                            <td>Calculating Time:</td>
     324                            <td class="text-right">{{task.CalculatingTime | toTimespan}}</td>
     325                        </tr>
     326                        @if (Request.IsAuthenticated && User.IsInRole(HiveRoles.Administrator)) {
     327                            <tr>
     328                                <td>User:</td>
     329                                <td class="text-right">
     330                                    <a ng-href="#/statistics/users/{{task.UserId}}" ng-show="task.UserName">{{task.UserName}}</a>
     331                                    <span ng-hide="task.UserName">Unknown</span>
     332                                </td>
     333                            </tr>
     334                            <tr>
     335                                <td>Job:</td>
     336                                <td class="text-right">
     337                                    <a ng-href="#/statistics/jobs/{{task.JobId}}" ng-show="task.JobName">{{task.JobName}}</a>
     338                                    <span ng-hide="task.JobName">Unknown</span>
     339                                </td>
     340                            </tr>
     341                        }
     342                    </table>
     343                </div>
     344
     345            </div>
     346        </div>
     347    </div>
     348    <div ng-hide="taskPage.Tasks.length">
     349        <p class="text-center">Please select at least one state!</p>
     350    </div>
     351    <div class="row text-center" ng-show="taskPage.TotalTasks > taskPage.Tasks.length">
     352        <pagination max-size="10" total-items="taskPage.TotalTasks" ng-model="curTaskPage" ng-change="changeTaskPage()" items-per-page="taskPageSize"
     353                    boundary-links="true" rotate="false" num-pages="numPages"></pagination>
     354    </div>
     355</div>
     356
  • branches/HiveStatistics/sources/HeuristicLab.Services.WebApp.Statistics/3.3/WebApp/clients/details/clientTaskDetailsDialog.cshtml

    r12551 r12768  
    105105                    </div>
    106106                </div>
     107                <div class="row">
     108                    <div class="col-md-12">
     109                        <table class="table table-condensed table-no-border table-auto-width table-content">
     110                            <tr>
     111                                <td><a href="api/Statistics/Task/GetTaskDataById?id={{task.Id}}">Download</a></td>
     112                            </tr>
     113                        </table>
     114                    </div>
     115                </div>
    107116            </div>
    108117        </tab>
  • branches/HiveStatistics/sources/HeuristicLab.Services.WebApp.Statistics/3.3/WebApp/jobs/details/jobTaskDetailsDialog.cshtml

    r12551 r12768  
    8484                    </div>
    8585                </div>
     86                <div class="row">
     87                    <div class="col-md-12">
     88                        <table class="table table-condensed table-no-border table-auto-width table-content">
     89                            <tr>
     90                                <td><a href="api/Statistics/Task/GetTaskDataById?id={{task.Id}}">Download</a></td>
     91                            </tr>
     92                        </table>
     93                    </div>
     94                </div>
    8695            </div>
    8796        </tab>
  • branches/HiveStatistics/sources/HeuristicLab.Services.WebApp.Status/3.3/WebApp/history/history.cshtml

    r12761 r12768  
    3838                <ul class="dropdown-menu" role="menu">
    3939                    <li ng-repeat="quickSelection in quickSelectionList">
    40                         <a ng-click="changeQuickSelection(quickSelection)">{{quickSelection.name}}</a>
     40                        <a class="cursor-pointer" ng-click="changeQuickSelection(quickSelection)">{{quickSelection.name}}</a>
    4141                    </li>
    4242                </ul>
  • branches/HiveStatistics/sources/HeuristicLab.Services.WebApp/3.3/WebApp/plugins/plugins/plugins.cshtml

    r12558 r12768  
    2323                                <th ts-criteria="AssemblyName">Assembly</th>
    2424                                <th ts-criteria="LastReload">Last reload</th>
    25                                 <th>Status</th>
     25                                <th class="text-center">Status</th>
    2626                                <th></th>
    2727                            </tr>
     
    3333                                <td>{{plugin.AssemblyName}}</td>
    3434                                <td>{{plugin.LastReload}}</td>
    35                                 <td>
     35                                <td class="text-center">
    3636                                    <span ng-hide="plugin.Exception" class="glyphicon glyphicon glyphicon-ok" style="color: green"></span>
    3737                                    <span ng-show="plugin.Exception" class="glyphicon glyphicon glyphicon-remove" style="color: darkred"
Note: See TracChangeset for help on using the changeset viewer.