Changeset 12484
- Timestamp:
- 06/19/15 18:06:19 (9 years ago)
- Location:
- branches/HiveStatistics/sources
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveStatistics/sources/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/GenericDao.cs
r12468 r12484 108 108 } 109 109 110 public bool Exists(T entity) { 111 return Table.Contains(entity); 112 } 113 110 114 public bool Exists(PK id) { 111 115 return GetById(id) != null; -
branches/HiveStatistics/sources/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/SlaveDao.cs
r12468 r12484 112 112 } 113 113 114 public bool Exists(Slave entity) { 115 return Table.Contains(entity); 116 } 117 114 118 public bool Exists(Guid id) { 115 119 return GetById(id) != null; -
branches/HiveStatistics/sources/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/SlaveGroupDao.cs
r12468 r12484 111 111 } 112 112 113 public bool Exists(SlaveGroup entity) { 114 return Table.Contains(entity); 115 } 116 113 117 public bool Exists(Guid id) { 114 118 return GetById(id) != null; -
branches/HiveStatistics/sources/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml
r12477 r12484 225 225 <Type Name="FactTask"> 226 226 <Column Name="TaskId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" /> 227 <Column Name=" TotalRuntime" Type="System.Double" DbType="Float NOT NULL" CanBeNull="false" />228 <Column Name=" TotalWaitingTime" Type="System.Double" DbType="Float NOT NULL" CanBeNull="false" />229 <Column Name="T otalTransferTime" Type="System.Double" DbType="Float NOT NULL" CanBeNull="false" />227 <Column Name="CalculatingTime" Storage="_TotalRuntime" Type="System.Double" DbType="Float NOT NULL" CanBeNull="false" /> 228 <Column Name="WaitingTime" Storage="_TotalWaitingTime" Type="System.Double" DbType="Float NOT NULL" CanBeNull="false" /> 229 <Column Name="TransferTime" Storage="_TotalTransferTime" Type="System.Double" DbType="Float NOT NULL" CanBeNull="false" /> 230 230 <Column Name="NumCalculationRuns" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" /> 231 231 <Column Name="NumRetries" Storage="_NumFails" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" /> … … 235 235 <Column Name="LastClientId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="true" /> 236 236 <Column Name="JobId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" /> 237 <Column Name="StartTime" Type="System.DateTime" DbType="DateTime NOT NULL" CanBeNull="false" />238 237 <Column Name="EndTime" Type="System.DateTime" DbType="DateTime NOT NULL" CanBeNull="true" /> 239 238 <Column Name="TaskState" Type="global::HeuristicLab.Services.Hive.DataAccess.TaskState" DbType="varchar(30)" CanBeNull="false" /> 240 239 <Column Name="Exception" Type="System.String" DbType="varchar(MAX)" CanBeNull="true" /> 240 <Column Name="InitialWaitingTime" Storage="_InitialWaitingTimeMs" Type="System.Double" CanBeNull="false" /> 241 <Column Name="StartTime" Type="System.DateTime" CanBeNull="true" /> 241 242 <Association Name="DimClient_FactTask" Member="DimClient" ThisKey="LastClientId" OtherKey="Id" Type="DimClient" IsForeignKey="true" /> 242 243 <Association Name="DimJob_FactTask" Member="DimJob" ThisKey="JobId" OtherKey="JobId" Type="DimJob" IsForeignKey="true" /> 243 <Association Name="DimTime_FactTask" Member="DimTimeEnd" Storage="_DimTime" ThisKey="EndTime" OtherKey="Time" Type="DimTime" IsForeignKey="true" />244 <Association Name="DimTime_FactTask1" Member="DimTimeStart" Storage="_DimTime1" ThisKey="StartTime" OtherKey="Time" Type="DimTime" IsForeignKey="true" />245 244 </Type> 246 245 </Table> … … 251 250 <Column Name="JobName" Type="System.String" DbType="VarChar(MAX) NOT NULL" CanBeNull="false" /> 252 251 <Column Name="UserName" Type="System.String" DbType="VarChar(MAX) NOT NULL" CanBeNull="false" /> 253 <Column Member="DateCreated" Type="System.DateTime" CanBeNull="false" />252 <Column Name="DateCreated" Type="System.DateTime" CanBeNull="false" /> 254 253 <Association Name="DimJob_FactTask" Member="FactTasks" ThisKey="JobId" OtherKey="JobId" Type="FactTask" /> 255 254 </Type> … … 262 261 <Column Name="Month" Type="System.DateTime" DbType="Date NOT NULL" CanBeNull="false" /> 263 262 <Column Name="Year" Type="System.DateTime" DbType="Date NOT NULL" CanBeNull="false" /> 264 <Association Name="DimTime_FactTask" Member="FactTasks" ThisKey="Time" OtherKey="EndTime" Type="FactTask" /> 265 <Association Name="DimTime_FactTask1" Member="FactTasks1" ThisKey="Time" OtherKey="StartTime" Type="FactTask" /> 263 <Column Name="Minute" Type="System.DateTime" CanBeNull="false" /> 266 264 <Association Name="DimTime_FactClientInfo" Member="FactClientInfos" ThisKey="Time" OtherKey="Time" Type="FactClientInfo" /> 267 265 </Type> -
branches/HiveStatistics/sources/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml.layout
r12477 r12484 253 253 </nestedChildShapes> 254 254 </classShape> 255 <classShape Id="04f52807-ce17-4d65-bd23-cc38c6dfbd7a" absoluteBounds="6.875, 11.25, 2, 3. 6939111328125005">255 <classShape Id="04f52807-ce17-4d65-bd23-cc38c6dfbd7a" absoluteBounds="6.875, 11.25, 2, 3.8862125651041666"> 256 256 <DataClassMoniker Name="/HiveDataContext/FactTask" /> 257 257 <nestedChildShapes> 258 <elementListCompartment Id="63e3ddcb-a6fe-48e0-a674-e650a55a9f2c" absoluteBounds="6.8900000000000006, 11.71, 1.9700000000000002, 3. 1339111328125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />258 <elementListCompartment Id="63e3ddcb-a6fe-48e0-a674-e650a55a9f2c" absoluteBounds="6.8900000000000006, 11.71, 1.9700000000000002, 3.3262125651041665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" /> 259 259 </nestedChildShapes> 260 260 </classShape> … … 265 265 </nestedChildShapes> 266 266 </classShape> 267 <classShape Id="a769f2ac-c8e3-4860-baa5-c46f46c38ed8" absoluteBounds="3.625, 8.5, 2, 1. 7708968098958344">267 <classShape Id="a769f2ac-c8e3-4860-baa5-c46f46c38ed8" absoluteBounds="3.625, 8.5, 2, 1.9631982421875005"> 268 268 <DataClassMoniker Name="/HiveDataContext/DimTime" /> 269 269 <nestedChildShapes> 270 <elementListCompartment Id="694c4a5a-20fb-43a9-bc9a-7b59d794a7fb" absoluteBounds="3.6399999999999997, 8.96, 1.9700000000000002, 1. 2108968098958333" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />270 <elementListCompartment Id="694c4a5a-20fb-43a9-bc9a-7b59d794a7fb" absoluteBounds="3.6399999999999997, 8.96, 1.9700000000000002, 1.4031982421875" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" /> 271 271 </nestedChildShapes> 272 272 </classShape> … … 283 283 </nestedChildShapes> 284 284 </classShape> 285 <associationConnector edgePoints="[(6.625 : 15.25); (6.875 : 1 4.9439111328125)]" fixedFrom="NotFixed" fixedTo="NotFixed">285 <associationConnector edgePoints="[(6.625 : 15.25); (6.875 : 15.1362125651042)]" fixedFrom="NotFixed" fixedTo="NotFixed"> 286 286 <AssociationMoniker Name="/HiveDataContext/DimClient/DimClient_FactTask" /> 287 287 <nodes> … … 290 290 </nodes> 291 291 </associationConnector> 292 <associationConnector edgePoints="[(8.5 : 10.8958968098958); (8.5 : 11.25)]" fixedFrom=" Algorithm" fixedTo="Algorithm">292 <associationConnector edgePoints="[(8.5 : 10.8958968098958); (8.5 : 11.25)]" fixedFrom="NotFixed" fixedTo="NotFixed"> 293 293 <AssociationMoniker Name="/HiveDataContext/DimJob/DimJob_FactTask" /> 294 294 <nodes> … … 297 297 </nodes> 298 298 </associationConnector> 299 <associationConnector edgePoints="[(5.02343625 : 10.2708968098958); (5.02343625 : 14.7227579166667); (5.90885291666667 : 14.7227579166667 : JumpStart); (6.07551958333333 : 14.7227579166667 : JumpEnd); (6.875 : 14.7227579166667)]" fixedFrom="NotFixed" fixedTo="NotFixed"> 300 <AssociationMoniker Name="/HiveDataContext/DimTime/DimTime_FactTask" /> 301 <nodes> 302 <classShapeMoniker Id="a769f2ac-c8e3-4860-baa5-c46f46c38ed8" /> 303 <classShapeMoniker Id="04f52807-ce17-4d65-bd23-cc38c6dfbd7a" /> 304 </nodes> 305 </associationConnector> 306 <associationConnector edgePoints="[(5.4218775 : 10.2708968098958); (5.4218775 : 13.3576659570313); (5.90885291666667 : 13.3576659570313 : JumpStart); (6.07551958333333 : 13.3576659570313 : JumpEnd); (6.71675495975 : 13.3576659570313); (6.71675495975 : 13.3568567264325); (6.875 : 13.3568567264325)]" manuallyRouted="true" fixedFrom="NotFixed" fixedTo="NotFixed"> 307 <AssociationMoniker Name="/HiveDataContext/DimTime/DimTime_FactTask1" /> 308 <nodes> 309 <classShapeMoniker Id="a769f2ac-c8e3-4860-baa5-c46f46c38ed8" /> 310 <classShapeMoniker Id="04f52807-ce17-4d65-bd23-cc38c6dfbd7a" /> 311 </nodes> 312 </associationConnector> 313 <associationConnector edgePoints="[(5.99218625 : 15.25); (5.99218625 : 12.1788329785157); (5.50521083333333 : 12.1788329785157 : JumpStart); (5.33854416666667 : 12.1788329785157 : JumpEnd); (5.10676958333333 : 12.1788329785157 : JumpStart); (4.94010291666667 : 12.1788329785157 : JumpEnd); (4.625 : 12.1788329785157)]" fixedFrom="NotFixed" fixedTo="NotFixed"> 299 <associationConnector edgePoints="[(5.99218625 : 15.25); (5.99218625 : 12.1788329785157); (4.625 : 12.1788329785157)]" fixedFrom="NotFixed" fixedTo="NotFixed"> 314 300 <AssociationMoniker Name="/HiveDataContext/DimClient/DimClient_FactClientInfo" /> 315 301 <nodes> … … 318 304 </nodes> 319 305 </associationConnector> 320 <associationConnector edgePoints="[(4.125 : 10. 2708968098958); (4.125 : 11)]" fixedFrom="NotFixed" fixedTo="NotFixed">306 <associationConnector edgePoints="[(4.125 : 10.4631982421875); (4.125 : 11)]" fixedFrom="Algorithm" fixedTo="Algorithm"> 321 307 <AssociationMoniker Name="/HiveDataContext/DimTime/DimTime_FactClientInfo" /> 322 308 <nodes> -
branches/HiveStatistics/sources/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.designer.cs
r12477 r12484 4867 4867 private System.Guid _JobId; 4868 4868 4869 private System.DateTime _StartTime;4870 4871 4869 private System.Nullable<System.DateTime> _EndTime; 4872 4870 … … 4875 4873 private string _Exception; 4876 4874 4875 private double _InitialWaitingTimeMs; 4876 4877 private System.Nullable<System.DateTime> _StartTime; 4878 4877 4879 private EntityRef<DimClient> _DimClient; 4878 4880 4879 4881 private EntityRef<DimJob> _DimJob; 4880 4881 private EntityRef<DimTime> _DimTime;4882 4883 private EntityRef<DimTime> _DimTime1;4884 4882 4885 4883 #region Extensibility Method Definitions … … 4889 4887 partial void OnTaskIdChanging(System.Guid value); 4890 4888 partial void OnTaskIdChanged(); 4891 partial void On TotalRuntimeChanging(double value);4892 partial void On TotalRuntimeChanged();4893 partial void On TotalWaitingTimeChanging(double value);4894 partial void On TotalWaitingTimeChanged();4895 partial void OnT otalTransferTimeChanging(double value);4896 partial void OnT otalTransferTimeChanged();4889 partial void OnCalculatingTimeChanging(double value); 4890 partial void OnCalculatingTimeChanged(); 4891 partial void OnWaitingTimeChanging(double value); 4892 partial void OnWaitingTimeChanged(); 4893 partial void OnTransferTimeChanging(double value); 4894 partial void OnTransferTimeChanged(); 4897 4895 partial void OnNumCalculationRunsChanging(int value); 4898 4896 partial void OnNumCalculationRunsChanged(); … … 4909 4907 partial void OnJobIdChanging(System.Guid value); 4910 4908 partial void OnJobIdChanged(); 4911 partial void OnStartTimeChanging(System.DateTime value);4912 partial void OnStartTimeChanged();4913 4909 partial void OnEndTimeChanging(System.Nullable<System.DateTime> value); 4914 4910 partial void OnEndTimeChanged(); … … 4917 4913 partial void OnExceptionChanging(string value); 4918 4914 partial void OnExceptionChanged(); 4915 partial void OnInitialWaitingTimeChanging(double value); 4916 partial void OnInitialWaitingTimeChanged(); 4917 partial void OnStartTimeChanging(System.Nullable<System.DateTime> value); 4918 partial void OnStartTimeChanged(); 4919 4919 #endregion 4920 4920 … … 4923 4923 this._DimClient = default(EntityRef<DimClient>); 4924 4924 this._DimJob = default(EntityRef<DimJob>); 4925 this._DimTime = default(EntityRef<DimTime>);4926 this._DimTime1 = default(EntityRef<DimTime>);4927 4925 OnCreated(); 4928 4926 } … … 4949 4947 4950 4948 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TotalRuntime", DbType="Float NOT NULL")] 4951 public double TotalRuntime4949 public double CalculatingTime 4952 4950 { 4953 4951 get … … 4959 4957 if ((this._TotalRuntime != value)) 4960 4958 { 4961 this.On TotalRuntimeChanging(value);4959 this.OnCalculatingTimeChanging(value); 4962 4960 this.SendPropertyChanging(); 4963 4961 this._TotalRuntime = value; 4964 this.SendPropertyChanged(" TotalRuntime");4965 this.On TotalRuntimeChanged();4962 this.SendPropertyChanged("CalculatingTime"); 4963 this.OnCalculatingTimeChanged(); 4966 4964 } 4967 4965 } … … 4969 4967 4970 4968 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TotalWaitingTime", DbType="Float NOT NULL")] 4971 public double TotalWaitingTime4969 public double WaitingTime 4972 4970 { 4973 4971 get … … 4979 4977 if ((this._TotalWaitingTime != value)) 4980 4978 { 4981 this.On TotalWaitingTimeChanging(value);4979 this.OnWaitingTimeChanging(value); 4982 4980 this.SendPropertyChanging(); 4983 4981 this._TotalWaitingTime = value; 4984 this.SendPropertyChanged(" TotalWaitingTime");4985 this.On TotalWaitingTimeChanged();4982 this.SendPropertyChanged("WaitingTime"); 4983 this.OnWaitingTimeChanged(); 4986 4984 } 4987 4985 } … … 4989 4987 4990 4988 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TotalTransferTime", DbType="Float NOT NULL")] 4991 public double T otalTransferTime4989 public double TransferTime 4992 4990 { 4993 4991 get … … 4999 4997 if ((this._TotalTransferTime != value)) 5000 4998 { 5001 this.OnT otalTransferTimeChanging(value);4999 this.OnTransferTimeChanging(value); 5002 5000 this.SendPropertyChanging(); 5003 5001 this._TotalTransferTime = value; 5004 this.SendPropertyChanged("T otalTransferTime");5005 this.OnT otalTransferTimeChanged();5002 this.SendPropertyChanged("TransferTime"); 5003 this.OnTransferTimeChanged(); 5006 5004 } 5007 5005 } … … 5156 5154 } 5157 5155 5158 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_StartTime", DbType="DateTime NOT NULL")] 5159 public System.DateTime StartTime 5156 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_EndTime", DbType="DateTime NOT NULL")] 5157 public System.Nullable<System.DateTime> EndTime 5158 { 5159 get 5160 { 5161 return this._EndTime; 5162 } 5163 set 5164 { 5165 if ((this._EndTime != value)) 5166 { 5167 this.OnEndTimeChanging(value); 5168 this.SendPropertyChanging(); 5169 this._EndTime = value; 5170 this.SendPropertyChanged("EndTime"); 5171 this.OnEndTimeChanged(); 5172 } 5173 } 5174 } 5175 5176 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TaskState", DbType="varchar(30)", CanBeNull=false)] 5177 public global::HeuristicLab.Services.Hive.DataAccess.TaskState TaskState 5178 { 5179 get 5180 { 5181 return this._TaskState; 5182 } 5183 set 5184 { 5185 if ((this._TaskState != value)) 5186 { 5187 this.OnTaskStateChanging(value); 5188 this.SendPropertyChanging(); 5189 this._TaskState = value; 5190 this.SendPropertyChanged("TaskState"); 5191 this.OnTaskStateChanged(); 5192 } 5193 } 5194 } 5195 5196 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Exception", DbType="varchar(MAX)")] 5197 public string Exception 5198 { 5199 get 5200 { 5201 return this._Exception; 5202 } 5203 set 5204 { 5205 if ((this._Exception != value)) 5206 { 5207 this.OnExceptionChanging(value); 5208 this.SendPropertyChanging(); 5209 this._Exception = value; 5210 this.SendPropertyChanged("Exception"); 5211 this.OnExceptionChanged(); 5212 } 5213 } 5214 } 5215 5216 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_InitialWaitingTimeMs")] 5217 public double InitialWaitingTime 5218 { 5219 get 5220 { 5221 return this._InitialWaitingTimeMs; 5222 } 5223 set 5224 { 5225 if ((this._InitialWaitingTimeMs != value)) 5226 { 5227 this.OnInitialWaitingTimeChanging(value); 5228 this.SendPropertyChanging(); 5229 this._InitialWaitingTimeMs = value; 5230 this.SendPropertyChanged("InitialWaitingTime"); 5231 this.OnInitialWaitingTimeChanged(); 5232 } 5233 } 5234 } 5235 5236 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_StartTime")] 5237 public System.Nullable<System.DateTime> StartTime 5160 5238 { 5161 5239 get … … 5167 5245 if ((this._StartTime != value)) 5168 5246 { 5169 if (this._DimTime1.HasLoadedOrAssignedValue)5170 {5171 throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();5172 }5173 5247 this.OnStartTimeChanging(value); 5174 5248 this.SendPropertyChanging(); … … 5180 5254 } 5181 5255 5182 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_EndTime", DbType="DateTime NOT NULL")]5183 public System.Nullable<System.DateTime> EndTime5184 {5185 get5186 {5187 return this._EndTime;5188 }5189 set5190 {5191 if ((this._EndTime != value))5192 {5193 if (this._DimTime.HasLoadedOrAssignedValue)5194 {5195 throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();5196 }5197 this.OnEndTimeChanging(value);5198 this.SendPropertyChanging();5199 this._EndTime = value;5200 this.SendPropertyChanged("EndTime");5201 this.OnEndTimeChanged();5202 }5203 }5204 }5205 5206 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TaskState", DbType="varchar(30)", CanBeNull=false)]5207 public global::HeuristicLab.Services.Hive.DataAccess.TaskState TaskState5208 {5209 get5210 {5211 return this._TaskState;5212 }5213 set5214 {5215 if ((this._TaskState != value))5216 {5217 this.OnTaskStateChanging(value);5218 this.SendPropertyChanging();5219 this._TaskState = value;5220 this.SendPropertyChanged("TaskState");5221 this.OnTaskStateChanged();5222 }5223 }5224 }5225 5226 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Exception", DbType="varchar(MAX)")]5227 public string Exception5228 {5229 get5230 {5231 return this._Exception;5232 }5233 set5234 {5235 if ((this._Exception != value))5236 {5237 this.OnExceptionChanging(value);5238 this.SendPropertyChanging();5239 this._Exception = value;5240 this.SendPropertyChanged("Exception");5241 this.OnExceptionChanged();5242 }5243 }5244 }5245 5246 5256 [global::System.Data.Linq.Mapping.AssociationAttribute(Name="DimClient_FactTask", Storage="_DimClient", ThisKey="LastClientId", OtherKey="Id", IsForeignKey=true)] 5247 5257 public DimClient DimClient … … 5308 5318 } 5309 5319 this.SendPropertyChanged("DimJob"); 5310 }5311 }5312 }5313 5314 [global::System.Data.Linq.Mapping.AssociationAttribute(Name="DimTime_FactTask", Storage="_DimTime", ThisKey="EndTime", OtherKey="Time", IsForeignKey=true)]5315 public DimTime DimTimeEnd5316 {5317 get5318 {5319 return this._DimTime.Entity;5320 }5321 set5322 {5323 DimTime previousValue = this._DimTime.Entity;5324 if (((previousValue != value)5325 || (this._DimTime.HasLoadedOrAssignedValue == false)))5326 {5327 this.SendPropertyChanging();5328 if ((previousValue != null))5329 {5330 this._DimTime.Entity = null;5331 previousValue.FactTasks.Remove(this);5332 }5333 this._DimTime.Entity = value;5334 if ((value != null))5335 {5336 value.FactTasks.Add(this);5337 this._EndTime = value.Time;5338 }5339 else5340 {5341 this._EndTime = default(Nullable<System.DateTime>);5342 }5343 this.SendPropertyChanged("DimTimeEnd");5344 }5345 }5346 }5347 5348 [global::System.Data.Linq.Mapping.AssociationAttribute(Name="DimTime_FactTask1", Storage="_DimTime1", ThisKey="StartTime", OtherKey="Time", IsForeignKey=true)]5349 public DimTime DimTimeStart5350 {5351 get5352 {5353 return this._DimTime1.Entity;5354 }5355 set5356 {5357 DimTime previousValue = this._DimTime1.Entity;5358 if (((previousValue != value)5359 || (this._DimTime1.HasLoadedOrAssignedValue == false)))5360 {5361 this.SendPropertyChanging();5362 if ((previousValue != null))5363 {5364 this._DimTime1.Entity = null;5365 previousValue.FactTasks1.Remove(this);5366 }5367 this._DimTime1.Entity = value;5368 if ((value != null))5369 {5370 value.FactTasks1.Add(this);5371 this._StartTime = value.Time;5372 }5373 else5374 {5375 this._StartTime = default(System.DateTime);5376 }5377 this.SendPropertyChanged("DimTimeStart");5378 5320 } 5379 5321 } … … 5603 5545 private System.DateTime _Year; 5604 5546 5605 private EntitySet<FactTask> _FactTasks; 5606 5607 private EntitySet<FactTask> _FactTasks1; 5547 private System.DateTime _Minute; 5608 5548 5609 5549 private EntitySet<FactClientInfo> _FactClientInfos; … … 5623 5563 partial void OnYearChanging(System.DateTime value); 5624 5564 partial void OnYearChanged(); 5565 partial void OnMinuteChanging(System.DateTime value); 5566 partial void OnMinuteChanged(); 5625 5567 #endregion 5626 5568 5627 5569 public DimTime() 5628 5570 { 5629 this._FactTasks = new EntitySet<FactTask>(new Action<FactTask>(this.attach_FactTasks), new Action<FactTask>(this.detach_FactTasks));5630 this._FactTasks1 = new EntitySet<FactTask>(new Action<FactTask>(this.attach_FactTasks1), new Action<FactTask>(this.detach_FactTasks1));5631 5571 this._FactClientInfos = new EntitySet<FactClientInfo>(new Action<FactClientInfo>(this.attach_FactClientInfos), new Action<FactClientInfo>(this.detach_FactClientInfos)); 5632 5572 OnCreated(); … … 5733 5673 } 5734 5674 5735 [global::System.Data.Linq.Mapping.AssociationAttribute(Name="DimTime_FactTask", Storage="_FactTasks", ThisKey="Time", OtherKey="EndTime")] 5736 public EntitySet<FactTask> FactTasks 5737 { 5738 get 5739 { 5740 return this._FactTasks; 5741 } 5742 set 5743 { 5744 this._FactTasks.Assign(value); 5745 } 5746 } 5747 5748 [global::System.Data.Linq.Mapping.AssociationAttribute(Name="DimTime_FactTask1", Storage="_FactTasks1", ThisKey="Time", OtherKey="StartTime")] 5749 public EntitySet<FactTask> FactTasks1 5750 { 5751 get 5752 { 5753 return this._FactTasks1; 5754 } 5755 set 5756 { 5757 this._FactTasks1.Assign(value); 5675 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Minute")] 5676 public System.DateTime Minute 5677 { 5678 get 5679 { 5680 return this._Minute; 5681 } 5682 set 5683 { 5684 if ((this._Minute != value)) 5685 { 5686 this.OnMinuteChanging(value); 5687 this.SendPropertyChanging(); 5688 this._Minute = value; 5689 this.SendPropertyChanged("Minute"); 5690 this.OnMinuteChanged(); 5691 } 5758 5692 } 5759 5693 } … … 5790 5724 this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); 5791 5725 } 5792 }5793 5794 private void attach_FactTasks(FactTask entity)5795 {5796 this.SendPropertyChanging();5797 entity.DimTimeEnd = this;5798 }5799 5800 private void detach_FactTasks(FactTask entity)5801 {5802 this.SendPropertyChanging();5803 entity.DimTimeEnd = null;5804 }5805 5806 private void attach_FactTasks1(FactTask entity)5807 {5808 this.SendPropertyChanging();5809 entity.DimTimeStart = this;5810 }5811 5812 private void detach_FactTasks1(FactTask entity)5813 {5814 this.SendPropertyChanging();5815 entity.DimTimeStart = null;5816 5726 } 5817 5727 -
branches/HiveStatistics/sources/HeuristicLab.Services.Hive.DataAccess/3.3/Interfaces/IGenericDao.cs
r12468 r12484 40 40 void Delete(T entity); 41 41 void Delete(IEnumerable<T> entities); 42 bool Exists(T entity); 42 43 bool Exists(PK id); 43 44 } -
branches/HiveStatistics/sources/HeuristicLab.Services.Hive.DataAccess/3.3/SQL Scripts/Initialize Hive Database.sql
r12477 r12484 202 202 203 203 CREATE TABLE [statistics].[DimTime] ( 204 [Time] DATETIME NOT NULL, 205 [Hour] DATETIME NOT NULL, 206 [Day] DATE NOT NULL, 207 [Month] DATE NOT NULL, 208 [Year] DATE NOT NULL, 204 [Time] DATETIME NOT NULL, 205 [Minute] DATETIME NOT NULL, 206 [Hour] DATETIME NOT NULL, 207 [Day] DATE NOT NULL, 208 [Month] DATE NOT NULL, 209 [Year] DATE NOT NULL, 209 210 CONSTRAINT [PK_DimTime] PRIMARY KEY CLUSTERED ([Time] ASC) 210 211 ); … … 223 224 [JobName] VARCHAR (MAX) NOT NULL, 224 225 [UserName] VARCHAR (MAX) NOT NULL, 225 226 [DateCreated] DATETIME NOT NULL, 226 227 CONSTRAINT [PK_DimJob] PRIMARY KEY CLUSTERED ([JobId] ASC) 227 228 ); … … 252 253 ); 253 254 CREATE TABLE [statistics].[FactTask] ( 254 [TaskId] UNIQUEIDENTIFIER NOT NULL, 255 [TotalRuntime] FLOAT (53) NOT NULL, 256 [TotalWaitingTime] FLOAT (53) NOT NULL, 257 [TotalTransferTime] FLOAT (53) NOT NULL, 258 [NumCalculationRuns] INT NOT NULL, 259 [NumRetries] INT NOT NULL, 260 [CoresRequired] INT NOT NULL, 261 [MemoryRequired] INT NOT NULL, 262 [Priority] INT NOT NULL, 263 [LastClientId] UNIQUEIDENTIFIER NULL, 264 [JobId] UNIQUEIDENTIFIER NOT NULL, 265 [StartTime] DATETIME NOT NULL, 266 [EndTime] DATETIME NULL, 267 [TaskState] VARCHAR (30) NOT NULL, 268 [Exception] VARCHAR (MAX) NULL, 255 [TaskId] UNIQUEIDENTIFIER NOT NULL, 256 [CalculatingTime] FLOAT (53) NOT NULL, 257 [WaitingTime] FLOAT (53) NOT NULL, 258 [TransferTime] FLOAT (53) NOT NULL, 259 [NumCalculationRuns] INT NOT NULL, 260 [NumRetries] INT NOT NULL, 261 [CoresRequired] INT NOT NULL, 262 [MemoryRequired] INT NOT NULL, 263 [Priority] INT NOT NULL, 264 [LastClientId] UNIQUEIDENTIFIER NULL, 265 [JobId] UNIQUEIDENTIFIER NOT NULL, 266 [StartTime] DATETIME NULL, 267 [EndTime] DATETIME NULL, 268 [TaskState] VARCHAR (30) NOT NULL, 269 [Exception] VARCHAR (MAX) NULL, 270 [InitialWaitingTime] FLOAT (53) NULL, 269 271 CONSTRAINT [PK_FactTask] PRIMARY KEY CLUSTERED ([TaskId] ASC), 270 272 CONSTRAINT [FK_FactTask_DimClient] FOREIGN KEY ([LastClientId]) REFERENCES [statistics].[DimClient] ([Id]), 271 CONSTRAINT [FK_FactTask_DimJob] FOREIGN KEY ([JobId]) REFERENCES [statistics].[DimJob] ([JobId]), 272 CONSTRAINT [FK_FactTask_DimTimeStart] FOREIGN KEY ([StartTime]) REFERENCES [statistics].[DimTime] ([Time]), 273 CONSTRAINT [FK_FactTask_DimTimeEnd] FOREIGN KEY ([EndTime]) REFERENCES [statistics].[DimTime] ([Time]) 273 CONSTRAINT [FK_FactTask_DimJob] FOREIGN KEY ([JobId]) REFERENCES [statistics].[DimJob] ([JobId]) 274 274 ); 275 275 -
branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/HiveJanitor.cs
r12477 r12484 49 49 public HiveJanitor() { 50 50 stop = false; 51 cleanupWaitHandle = new AutoResetEvent( true);52 generateStatisticsWaitHandle = new AutoResetEvent( true);51 cleanupWaitHandle = new AutoResetEvent(false); 52 generateStatisticsWaitHandle = new AutoResetEvent(false); 53 53 } 54 54 -
branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/HiveStatisticsGenerator.cs
r12477 r12484 38 38 UpdateDimUserTable(pm); 39 39 UpdateDimJobTable(pm); 40 UpdateDimClients (pm);40 UpdateDimClientsTable(pm); 41 41 pm.SubmitChanges(); 42 42 }); … … 47 47 pm.SubmitChanges(); 48 48 UpdateFactClientInfoTable(newTime, pm); 49 UpdateTaskFacts (newTime, pm);49 UpdateTaskFactsTable(newTime, pm); 50 50 try { 51 51 pm.SubmitChanges(); … … 67 67 var now = DateTime.Now; 68 68 var timeEntry = new DimTime { 69 Time = new DateTime(now.Year, now.Month, now.Day, now.Hour, now.Minute, 0), 69 Time = now, 70 Minute = new DateTime(now.Year, now.Month, now.Day, now.Hour, now.Minute, 0), 70 71 Hour = new DateTime(now.Year, now.Month, now.Day, now.Hour, 0, 0), 71 72 Day = new DateTime(now.Year, now.Month, now.Day, 0, 0, 0), … … 73 74 Year = new DateTime(now.Year, 1, 1, 0, 0, 0) 74 75 }; 75 // using SaveOrAttach instead of save because the table can only be updated once every minute 76 // (pk restriction) save would cause a duplicate key exception if the method is accidentally 77 // called more than once every minute (e.g. restarting the service within a minute) 78 return dimTimeDao.SaveOrAttach(timeEntry); 76 return dimTimeDao.Save(timeEntry); 79 77 } 80 78 … … 118 116 } 119 117 120 private void UpdateDimClients (PersistenceManager pm) {118 private void UpdateDimClientsTable(PersistenceManager pm) { 121 119 var dimClientDao = pm.DimClientDao; 122 120 var slaveDao = pm.SlaveDao; … … 208 206 } 209 207 210 private void UpdateTaskFacts (DimTime newTime, PersistenceManager pm) {208 private void UpdateTaskFactsTable(DimTime newTime, PersistenceManager pm) { 211 209 var factTaskDao = pm.FactTaskDao; 212 210 var taskDao = pm.TaskDao; … … 217 215 var notFinishedFactTasks = factTaskDao.GetNotFinishedTasks().Select(x => new { 218 216 x.TaskId, 219 x.DimTimeStart,220 217 x.LastClientId 221 218 }); … … 238 235 MemoryRequired = task.MemoryNeeded, 239 236 State = task.State, 240 StateLogs = stateLogs, 241 DimTimeStart = lastFact != null ? lastFact.DimTimeStart : newTime, 237 StateLogs = stateLogs.OrderBy(x => x.DateTime), 242 238 LastClientId = client != null 243 239 ? client.Id : lastFact != null 244 240 ? lastFact.LastClientId : (Guid?)null 245 241 }; 246 247 var endStates = new[] { TaskState.Finished, TaskState.Failed, TaskState.Aborted };248 242 factTaskDao.Save( 249 243 from x in newTasks.ToList() 250 let stateLogsLinkedList = new LinkedList<StateLog>(x.StateLogs.OrderBy(y => y.DateTime)) 251 let lastStateLog = stateLogsLinkedList.OrderByDescending(y => y.DateTime).FirstOrDefault(sl => sl.Exception != null) 244 let taskData = CalculateFactTaskData(x.StateLogs) 252 245 select new FactTask { 253 246 TaskId = x.TaskId, 254 247 JobId = x.JobId, 255 DimTimeStart = x.DimTimeStart,256 DimTimeEnd = endStates.Contains(x.State) ? newTime : null,248 StartTime = taskData.StartTime, 249 EndTime = taskData.EndTime, 257 250 LastClientId = x.LastClientId, 258 251 Priority = x.Priority, 259 252 CoresRequired = x.CoresRequired, 260 253 MemoryRequired = x.MemoryRequired, 261 NumCalculationRuns = stateLogsLinkedList.CountCalculationRuns(),262 NumRetries = stateLogsLinkedList.CountRetries(),263 TotalWaitingTime = stateLogsLinkedList.SumTotalTimeWhere(stateLog => stateLog.Value.State == TaskState.Waiting),264 TotalRuntime = stateLogsLinkedList.SumTotalTimeWhere(stateLog => stateLog.Value.State == TaskState.Calculating && stateLog.NextIs(y => y.State == TaskState.Transferring)),265 T otalTransferTime = stateLogsLinkedList.SumTotalTimeWhere(stateLog => stateLog.Value.State == TaskState.Transferring),254 NumCalculationRuns = taskData.CalculationRuns, 255 NumRetries = taskData.Retries, 256 WaitingTime = taskData.WaitingTime, 257 CalculatingTime = taskData.CalculatingTime, 258 TransferTime = taskData.TransferTime, 266 259 TaskState = x.State, 267 Exception = lastStateLog == null ? string.Empty : lastStateLog.Exception 260 Exception = taskData.Exception, 261 InitialWaitingTime = taskData.InitialWaitingTime 268 262 }); 269 263 factTaskDao.Delete(notFinishedFactTasks.Select(x => x.TaskId)); … … 280 274 } 281 275 } 282 } 283 284 public static class StateLogLinkedListExtensions { 285 public static int CountCalculationRuns(this LinkedList<StateLog> stateLogs) { 286 return stateLogs.EnumerateNodes() 287 .Count(sl => sl.Value.State == TaskState.Calculating && sl.NextIs(nsl => nsl.State == TaskState.Transferring)); 288 } 289 290 public static int CountRetries(this LinkedList<StateLog> stateLogs) { 291 return stateLogs.EnumerateNodes() 292 .Count(sl => sl.Value.State == TaskState.Calculating && sl.Next != null && sl.NextIs(nsl => nsl.State != TaskState.Transferring)); 293 } 294 295 public static double SumTotalTimeWhere(this LinkedList<StateLog> stateLogs, Predicate<LinkedListNode<StateLog>> predicate) { 296 return stateLogs.EnumerateNodes() 297 .Where(stateLog => predicate(stateLog)) 298 .Sum(stateLog => stateLog.Next != null ? (stateLog.Next.Value.DateTime - stateLog.Value.DateTime).TotalMinutes : 0.0); 299 } 300 } 301 302 public static class LinkedListExtensions { 303 public static IEnumerable<LinkedListNode<T>> EnumerateNodes<T>(this LinkedList<T> list) { 304 var node = list.First; 305 while (node != null) { 306 yield return node; 307 node = node.Next; 276 277 private class FactTaskData { 278 public int CalculationRuns { get; set; } 279 public int Retries { get; set; } 280 public double CalculatingTime { get; set; } 281 public double WaitingTime { get; set; } 282 public double TransferTime { get; set; } 283 public double InitialWaitingTime { get; set; } 284 public string Exception { get; set; } 285 public DateTime? StartTime { get; set; } 286 public DateTime? EndTime { get; set; } 287 } 288 289 private FactTaskData CalculateFactTaskData(IEnumerable<StateLog> stateLogs) { 290 var factTaskData = new FactTaskData(); 291 var enumerator = stateLogs.GetEnumerator(); 292 if (enumerator.MoveNext()) { 293 StateLog current = enumerator.Current, first = current, prev = null; 294 while (current != null) { 295 var next = enumerator.MoveNext() ? enumerator.Current : null; 296 int timeSpanInSeconds; 297 if (next != null) { 298 timeSpanInSeconds = (int)(next.DateTime - current.DateTime).TotalSeconds; 299 } else { 300 timeSpanInSeconds = (int)(DateTime.Now - current.DateTime).TotalSeconds; 301 factTaskData.Exception = current.Exception; 302 } 303 switch (current.State) { 304 case TaskState.Calculating: 305 factTaskData.CalculatingTime += timeSpanInSeconds; 306 factTaskData.CalculationRuns++; 307 if (factTaskData.CalculationRuns == 1) { 308 factTaskData.StartTime = current.DateTime; 309 factTaskData.InitialWaitingTime = (int)(current.DateTime - first.DateTime).TotalSeconds; 310 } 311 if (prev != null && prev.State != TaskState.Transferring) { 312 factTaskData.Retries++; 313 } 314 break; 315 316 case TaskState.Waiting: 317 factTaskData.WaitingTime += timeSpanInSeconds; 318 break; 319 320 case TaskState.Transferring: 321 factTaskData.TransferTime += timeSpanInSeconds; 322 break; 323 324 case TaskState.Finished: 325 case TaskState.Failed: 326 case TaskState.Aborted: 327 factTaskData.EndTime = current.DateTime; 328 break; 329 } 330 prev = current; 331 current = next; 332 } 308 333 } 309 } 310 311 public static bool NextIs<T>(this LinkedListNode<T> node, Predicate<T> predicate) { 312 return node.Next != null && predicate(node.Next.Value); 334 return factTaskData; 313 335 } 314 336 } -
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp.Statistics/3.3/WebApi/DataController.cs
r12477 r12484 41 41 get { return ServiceLocator.Instance.UserManager; } 42 42 } 43 private IRoleVerifier RoleVerifier { 44 get { return ServiceLocator.Instance.RoleVerifier; } 45 } 46 private IAuthorizationManager AuthorizationManager { 47 get { return ServiceLocator.Instance.AuthorizationManager; } 48 } 43 49 44 50 public IEnumerable<DTO.Job> GetJobs() { … … 47 53 48 54 public IEnumerable<DTO.Job> GetJobsByUserId(Guid id) { 55 if (id != UserManager.CurrentUserId) { 56 RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator); 57 } 49 58 using (var pm = PersistenceManager) { 50 59 return pm.UseTransaction(() => { … … 62 71 using (var pm = PersistenceManager) { 63 72 return pm.UseTransaction(() => { 73 var dimJobDao = pm.JobDao; 64 74 var factTaskDao = pm.FactTaskDao; 75 var job = dimJobDao.GetById(id); 76 if (job != null && job.OwnerUserId != UserManager.CurrentUserId) { 77 RoleVerifier.AuthenticateForAllRoles(HiveRoles.Administrator); 78 } 65 79 return factTaskDao.GetByJobId(id).Select(x => new DTO.Task { 66 TotalRuntime = x.TotalRuntime, 67 TotalWaitingTime = x.TotalWaitingTime, 68 TotalTransferTime = x.TotalTransferTime, 80 Id = x.TaskId, 81 CalculatingTime = x.CalculatingTime, 82 WaitingTime = x.WaitingTime, 83 TransferTime = x.TransferTime, 84 InitialWaitingTime = x.InitialWaitingTime, 69 85 NumCalculationRuns = x.NumCalculationRuns, 70 86 NumRetries = x.NumRetries, … … 72 88 MemoryRequired = x.MemoryRequired, 73 89 Priority = x.Priority, 90 State = x.TaskState.ToString(), 74 91 LastClientId = x.LastClientId, 75 92 StartTime = x.StartTime, 76 EndTime = x.EndTime 93 EndTime = x.EndTime, 94 Exception = x.Exception 77 95 }).ToList(); 78 96 }); -
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp.Statistics/3.3/WebApi/DataTransfer/Task.cs
r12477 r12484 24 24 namespace HeuristicLab.Services.WebApp.Statistics.WebApi.DataTransfer { 25 25 public class Task { 26 public double TotalRuntime { get; set; } 27 public double TotalWaitingTime { get; set; } 28 public double TotalTransferTime { get; set; } 26 public Guid Id { get; set; } 27 public double CalculatingTime { get; set; } 28 public double WaitingTime { get; set; } 29 public double TransferTime { get; set; } 30 public double InitialWaitingTime { get; set; } 29 31 public int NumCalculationRuns { get; set; } 30 32 public int NumRetries { get; set; } … … 32 34 public int MemoryRequired { get; set; } 33 35 public int Priority { get; set; } 36 public string State { get; set; } 34 37 public Guid? LastClientId { get; set; } 35 public DateTime StartTime { get; set; }38 public DateTime? StartTime { get; set; } 36 39 public DateTime? EndTime { get; set; } 40 public string Exception { get; set; } 37 41 } 38 42 } -
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp.Statistics/3.3/WebApp/jobs/jobs.cshtml
r12477 r12484 27 27 </div> 28 28 <div class="panel-body"> 29 <table class="table table-hover ">29 <table class="table table-hover table-condensed"> 30 30 <thead> 31 <tr> 32 <th>#</th> 33 <th>Job Name</th> 34 <th>Date Created</th> 35 </tr> 31 <tr> 32 <th>#</th> 33 <th>Job Name</th> 34 <th>Date Created</th> 35 <th></th> 36 </tr> 36 37 </thead> 37 38 <tr ng-repeat="job in jobs"> … … 39 40 <td>{{job.Name}}</td> 40 41 <td>{{job.DateCreated}}</td> 42 <td><a ng-href="" data-ng-click="getTasksByJobId(job.Id)">Load Tasks</a></td> 41 43 </tr> 42 44 <tr ng-hide="jobs.length"> … … 49 51 </div> 50 52 53 <div class="row" ng-show="tasks.length"> 54 55 <div class="col-lg-3 col-md-6" ng-repeat="task in tasks"> 56 <div class="panel panel-default"> 57 58 <div class="panel-heading"> 59 <h3 class="panel-title">Task {{$index + 1}}</h3> 60 </div> 61 <div class="panel-body"> 62 <table class="table table-hover table-condensed table-no-border table-auto-width"> 63 <tr> 64 <td>Initial Waiting Time:</td> 65 <td>{{task.InitialWaitingTime}}</td> 66 </tr> 67 <tr> 68 <td>Waiting Time:</td> 69 <td>{{task.WaitingTime}}</td> 70 </tr> 71 <tr> 72 <td>Calculating Time:</td> 73 <td>{{task.CalculatingTime}}</td> 74 </tr> 75 <tr> 76 <td>Transfer Time:</td> 77 <td>{{task.TransferTime}}</td> 78 </tr> 79 <tr> 80 <td>Start Time:</td> 81 <td>{{task.StartTime}}</td> 82 </tr> 83 <tr> 84 <td>End Time:</td> 85 <td>{{task.EndTime}}</td> 86 </tr> 87 <tr> 88 <td>Calculation Runs:</td> 89 <td>{{task.NumCalculationRuns}}</td> 90 </tr> 91 <tr> 92 <td>Retries Runs:</td> 93 <td>{{task.NumRetries}}</td> 94 </tr> 95 <tr> 96 <td>Cores Required:</td> 97 <td>{{task.CoresRequired}}</td> 98 </tr> 99 <tr> 100 <td>Memory Required:</td> 101 <td>{{task.MemoryRequired}}</td> 102 </tr> 103 <tr> 104 <td>Priority:</td> 105 <td>{{task.Priority}}</td> 106 </tr> 107 </table> 108 </div> 109 110 </div> 111 </div> 112 </div> 51 113 </div> -
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp.Statistics/3.3/WebApp/jobs/jobsCtrl.js
r12477 r12484 8 8 }); 9 9 }; 10 11 $scope.getTasksByJobId = function(id) { 12 statisticsService.getTasksByJobId({ id: id }, function(tasks) { 13 $scope.tasks = tasks; 14 }); 15 }; 16 10 17 getJobs(); 11 18 }]
Note: See TracChangeset
for help on using the changeset viewer.