From: Nando D. <na...@us...> - 2005-02-22 10:41:19
|
Update of /cvsroot/instantobjects/Demos/PrimerCross In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20124/PrimerCross Modified Files: PerformanceView.dfm PerformanceView.pas Log Message: statement cache perf. test GUI reworked Index: PerformanceView.pas =================================================================== RCS file: /cvsroot/instantobjects/Demos/PrimerCross/PerformanceView.pas,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PerformanceView.pas 10 Feb 2005 23:06:19 -0000 1.7 --- PerformanceView.pas 22 Feb 2005 10:40:28 -0000 1.8 *************** *** 123,133 **** TestResultRenameItem: TMenuItem; TransactionsCheckBox: TCheckBox; ! NumberLabel: TLabel; ObjectsEdit: TMaskEdit; TestRetrieveCheckBox: TCheckBox; TestDisposeCheckBox: TCheckBox; - PoolOptionsRadioGroup: TRadioGroup; TestQueryCheckBox: TCheckBox; Series1: TBarSeries; procedure RunButtonClick(Sender: TObject); procedure TestResultListViewChange(Sender: TObject; Item: TListItem; --- 123,134 ---- TestResultRenameItem: TMenuItem; TransactionsCheckBox: TCheckBox; ! ObjectsLabel: TLabel; ObjectsEdit: TMaskEdit; TestRetrieveCheckBox: TCheckBox; TestDisposeCheckBox: TCheckBox; TestQueryCheckBox: TCheckBox; Series1: TBarSeries; + CacheSizeLabel: TLabel; + CacheSizeEdit: TMaskEdit; procedure RunButtonClick(Sender: TObject); procedure TestResultListViewChange(Sender: TObject; Item: TListItem; *************** *** 144,148 **** {$ENDIF} procedure TransactionsCheckBoxClick(Sender: TObject); - procedure PoolOptionsRadioGroupClick(Sender: TObject); procedure TestDisposeCheckBoxClick(Sender: TObject); procedure TestRetrieveCheckBoxClick(Sender: TObject); --- 145,148 ---- *************** *** 510,513 **** --- 510,515 ---- if not Confirm(Format('Run performance test on "%s"?', [ConnectionName])) then Exit; + TInstantSQLBroker(Connector.Broker).StatementCacheCapacity := + StrToInt(Trim(CacheSizeEdit.Text)); with TPersistenceTest.Create do try *************** *** 668,685 **** ObjectsEdit.Enabled := IsConnected; TestRetrieveCheckBox.Enabled := IsConnected; TestDisposeCheckBox.Enabled := IsConnected; if Assigned(Connector) and (Connector.Broker is TInstantSQLBroker) then begin ! PoolOptionsRadioGroup.Visible := True; ! PoolOptionsRadioGroup.Enabled := IsConnected; ! if TInstantSQLBroker(Connector.Broker).UsePreparedQuery then ! PoolOptionsRadioGroup.ItemIndex := 1 ! else if TInstantSQLBroker(Connector.Broker).StatementCacheCapacity <> 0 then ! PoolOptionsRadioGroup.ItemIndex := 2 ! else ! PoolOptionsRadioGroup.ItemIndex := 0; end else ! PoolOptionsRadioGroup.Visible := False; ConnectionLabel.Caption := 'Connection: ' + ConnectionName; --- 670,688 ---- ObjectsEdit.Enabled := IsConnected; TestRetrieveCheckBox.Enabled := IsConnected; + TestQueryCheckBox.Enabled := IsConnected; TestDisposeCheckBox.Enabled := IsConnected; if Assigned(Connector) and (Connector.Broker is TInstantSQLBroker) then begin ! CacheSizeEdit.Visible := True; ! CacheSizeLabel.Visible := CacheSizeEdit.Visible; ! CacheSizeEdit.Enabled := IsConnected; ! CacheSizeLabel.Enabled := CacheSizeEdit.Enabled; ! CacheSizeEdit.Text := IntToStr(TInstantSQLBroker(Connector.Broker).StatementCacheCapacity); end else ! begin ! CacheSizeEdit.Visible := False; ! CacheSizeLabel.Visible := False; ! end; ConnectionLabel.Caption := 'Connection: ' + ConnectionName; *************** *** 693,719 **** end; - procedure TPerformanceViewForm.PoolOptionsRadioGroupClick(Sender: TObject); - begin - inherited; - if Connector.Broker is TInstantSQLBroker then - case PoolOptionsRadioGroup.ItemIndex of - 0 : - begin - TInstantSQLBroker(Connector.Broker).UsePreparedQuery := False; - TInstantSQLBroker(Connector.Broker).StatementCacheCapacity := 0; - end; - 1 : - begin - TInstantSQLBroker(Connector.Broker).UsePreparedQuery := True; - TInstantSQLBroker(Connector.Broker).StatementCacheCapacity := 0; - end; - 2 : - begin - TInstantSQLBroker(Connector.Broker).UsePreparedQuery := False; - TInstantSQLBroker(Connector.Broker).StatementCacheCapacity := -1; - end; - end; - end; - procedure TPerformanceViewForm.SetTitleLabel(TitleLabel: TLabel); begin --- 696,699 ---- Index: PerformanceView.dfm =================================================================== RCS file: /cvsroot/instantobjects/Demos/PrimerCross/PerformanceView.dfm,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PerformanceView.dfm 10 Feb 2005 13:04:25 -0000 1.4 --- PerformanceView.dfm 22 Feb 2005 10:40:27 -0000 1.5 *************** *** 85,89 **** 8000001F8000001F8000001F0000001F38E0107FFDF079FFF8F9FFFF} end ! object NumberLabel: TLabel Left = 16 Top = 72 --- 85,89 ---- 8000001F8000001F8000001F0000001F38E0107FFDF079FFF8F9FFFF} end ! object ObjectsLabel: TLabel Left = 16 Top = 72 *************** *** 93,96 **** --- 93,104 ---- FocusControl = ObjectsEdit end + object CacheSizeLabel: TLabel + Left = 328 + Top = 72 + Width = 108 + Height = 13 + Caption = 'Statement &Cache Size:' + FocusControl = CacheSizeEdit + end object RunButton: TButton Left = 480 *************** *** 123,132 **** end object TransactionsCheckBox: TCheckBox ! Left = 479 ! Top = 16 Width = 112 Height = 17 Caption = 'Use &Transactions' ! TabOrder = 6 OnClick = TransactionsCheckBoxClick end --- 131,140 ---- end object TransactionsCheckBox: TCheckBox ! Left = 207 ! Top = 88 Width = 112 Height = 17 Caption = 'Use &Transactions' ! TabOrder = 5 OnClick = TransactionsCheckBoxClick end *************** *** 134,138 **** Left = 16 Top = 86 ! Width = 73 Height = 21 EditMask = '#########;1; ' --- 142,146 ---- Left = 16 Top = 86 ! Width = 81 Height = 21 EditMask = '#########;1; ' *************** *** 142,147 **** end object TestRetrieveCheckBox: TCheckBox ! Left = 101 ! Top = 66 Width = 95 Height = 17 --- 150,155 ---- end object TestRetrieveCheckBox: TCheckBox ! Left = 109 ! Top = 70 Width = 95 Height = 17 *************** *** 153,158 **** end object TestDisposeCheckBox: TCheckBox ! Left = 101 ! Top = 96 Width = 95 Height = 17 --- 161,166 ---- end object TestDisposeCheckBox: TCheckBox ! Left = 109 ! Top = 100 Width = 95 Height = 17 *************** *** 163,184 **** OnClick = TestDisposeCheckBoxClick end - object PoolOptionsRadioGroup: TRadioGroup - Left = 200 - Top = 68 - Width = 385 - Height = 47 - Caption = 'SQL brokers features' - Columns = 3 - ItemIndex = 0 - Items.Strings = ( - 'No cache' - 'Prepared queries' - 'Statements cache') - TabOrder = 5 - OnClick = PoolOptionsRadioGroupClick - end object TestQueryCheckBox: TCheckBox ! Left = 101 ! Top = 81 Width = 95 Height = 17 --- 171,177 ---- OnClick = TestDisposeCheckBoxClick end object TestQueryCheckBox: TCheckBox ! Left = 109 ! Top = 85 Width = 95 Height = 17 *************** *** 188,191 **** --- 181,194 ---- TabOrder = 3 end + object CacheSizeEdit: TMaskEdit + Left = 328 + Top = 86 + Width = 113 + Height = 21 + EditMask = '#########;1; ' + MaxLength = 9 + TabOrder = 6 + Text = '-1 ' + end end object ResultPanel: TPanel |