diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2009-12-11 17:02:44 -0800 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2009-12-11 17:02:44 -0800 |
commit | 5117f686511ba640cd0c0cb22be5f18bd743d072 (patch) | |
tree | e4856c1bed33a98a469cc1589076693e9cd93aef /src | |
parent | 99f61fa33b6173aa2d857566f5560e314c14fa94 (diff) | |
download | DotNetOpenAuth-5117f686511ba640cd0c0cb22be5f18bd743d072.zip DotNetOpenAuth-5117f686511ba640cd0c0cb22be5f18bd743d072.tar.gz DotNetOpenAuth-5117f686511ba640cd0c0cb22be5f18bd743d072.tar.bz2 |
Added a bunch of feature stats.
Diffstat (limited to 'src')
9 files changed, 44 insertions, 1 deletions
diff --git a/src/DotNetOpenAuth/InfoCard/InfoCardSelector.cs b/src/DotNetOpenAuth/InfoCard/InfoCardSelector.cs index de4d023..86c1118 100644 --- a/src/DotNetOpenAuth/InfoCard/InfoCardSelector.cs +++ b/src/DotNetOpenAuth/InfoCard/InfoCardSelector.cs @@ -199,6 +199,7 @@ namespace DotNetOpenAuth.InfoCard { /// </summary> public InfoCardSelector() { this.ToolTip = InfoCardStrings.SelectorClickPrompt; + Reporting.RecordFeatureUse(this); } /// <summary> diff --git a/src/DotNetOpenAuth/OAuth/ConsumerBase.cs b/src/DotNetOpenAuth/OAuth/ConsumerBase.cs index b9d4718..6c0ce42 100644 --- a/src/DotNetOpenAuth/OAuth/ConsumerBase.cs +++ b/src/DotNetOpenAuth/OAuth/ConsumerBase.cs @@ -34,6 +34,8 @@ namespace DotNetOpenAuth.OAuth { this.OAuthChannel = new OAuthChannel(signingElement, store, tokenManager); this.ServiceProvider = serviceDescription; this.SecuritySettings = DotNetOpenAuthSection.Configuration.OAuth.Consumer.SecuritySettings.CreateSecuritySettings(); + + Reporting.RecordFeatureAndDependencyUse(this, serviceDescription, tokenManager, null); } /// <summary> diff --git a/src/DotNetOpenAuth/OAuth/ServiceProvider.cs b/src/DotNetOpenAuth/OAuth/ServiceProvider.cs index e2c82bb..829b572 100644 --- a/src/DotNetOpenAuth/OAuth/ServiceProvider.cs +++ b/src/DotNetOpenAuth/OAuth/ServiceProvider.cs @@ -102,6 +102,8 @@ namespace DotNetOpenAuth.OAuth { this.OAuthChannel = new OAuthChannel(signingElement, nonceStore, tokenManager, messageTypeProvider); this.TokenGenerator = new StandardTokenGenerator(); this.SecuritySettings = DotNetOpenAuthSection.Configuration.OAuth.ServiceProvider.SecuritySettings.CreateSecuritySettings(); + + Reporting.RecordFeatureAndDependencyUse(this, serviceDescription, tokenManager, nonceStore); } /// <summary> diff --git a/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdMobileTextBox.cs b/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdMobileTextBox.cs index ce77df1..dbf9530 100644 --- a/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdMobileTextBox.cs +++ b/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdMobileTextBox.cs @@ -244,6 +244,7 @@ namespace DotNetOpenAuth.OpenId.RelyingParty { /// Initializes a new instance of the <see cref="OpenIdMobileTextBox"/> class. /// </summary> public OpenIdMobileTextBox() { + Reporting.RecordFeatureUse(this); } #region Events diff --git a/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingParty.cs b/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingParty.cs index 9336f73..55d6403 100644 --- a/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingParty.cs +++ b/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingParty.cs @@ -595,6 +595,7 @@ namespace DotNetOpenAuth.OpenId.RelyingParty { private void OnBehaviorsChanged(object sender, NotifyCollectionChangedEventArgs e) { foreach (IRelyingPartyBehavior profile in e.NewItems) { profile.ApplySecuritySettings(this.SecuritySettings); + Reporting.RecordFeatureUse(profile); } } diff --git a/src/DotNetOpenAuth/OpenId/RelyingParty/SelectorInfoCardButton.cs b/src/DotNetOpenAuth/OpenId/RelyingParty/SelectorInfoCardButton.cs index 74e37a6..c5dda1c 100644 --- a/src/DotNetOpenAuth/OpenId/RelyingParty/SelectorInfoCardButton.cs +++ b/src/DotNetOpenAuth/OpenId/RelyingParty/SelectorInfoCardButton.cs @@ -26,6 +26,7 @@ namespace DotNetOpenAuth.OpenId.RelyingParty { /// Initializes a new instance of the <see cref="SelectorInfoCardButton"/> class. /// </summary> public SelectorInfoCardButton() { + Reporting.RecordFeatureUse(this); } /// <summary> diff --git a/src/DotNetOpenAuth/OpenId/RelyingParty/SelectorOpenIdButton.cs b/src/DotNetOpenAuth/OpenId/RelyingParty/SelectorOpenIdButton.cs index 6e73152..0b11695 100644 --- a/src/DotNetOpenAuth/OpenId/RelyingParty/SelectorOpenIdButton.cs +++ b/src/DotNetOpenAuth/OpenId/RelyingParty/SelectorOpenIdButton.cs @@ -18,6 +18,7 @@ namespace DotNetOpenAuth.OpenId.RelyingParty { /// Initializes a new instance of the <see cref="SelectorOpenIdButton"/> class. /// </summary> public SelectorOpenIdButton() { + Reporting.RecordFeatureUse(this); } /// <summary> diff --git a/src/DotNetOpenAuth/OpenId/RelyingParty/SelectorProviderButton.cs b/src/DotNetOpenAuth/OpenId/RelyingParty/SelectorProviderButton.cs index 02a512a..1d4dcf2 100644 --- a/src/DotNetOpenAuth/OpenId/RelyingParty/SelectorProviderButton.cs +++ b/src/DotNetOpenAuth/OpenId/RelyingParty/SelectorProviderButton.cs @@ -20,6 +20,7 @@ namespace DotNetOpenAuth.OpenId.RelyingParty { /// Initializes a new instance of the <see cref="SelectorProviderButton"/> class. /// </summary> public SelectorProviderButton() { + Reporting.RecordFeatureUse(this); } /// <summary> diff --git a/src/DotNetOpenAuth/Reporting.cs b/src/DotNetOpenAuth/Reporting.cs index 9d066e9..3ac6099 100644 --- a/src/DotNetOpenAuth/Reporting.cs +++ b/src/DotNetOpenAuth/Reporting.cs @@ -20,6 +20,9 @@ namespace DotNetOpenAuth { using System.Web; using DotNetOpenAuth.Configuration; using DotNetOpenAuth.Messaging; + using DotNetOpenAuth.Messaging.Bindings; + using DotNetOpenAuth.OAuth; + using DotNetOpenAuth.OAuth.ChannelElements; /// <summary> /// The statistical reporting mechanism used so this library's project authors @@ -163,6 +166,36 @@ namespace DotNetOpenAuth { } /// <summary> + /// Records the feature and dependency use. + /// </summary> + /// <param name="value">The consumer or service provider.</param> + /// <param name="service">The service.</param> + /// <param name="tokenManager">The token manager.</param> + /// <param name="nonceStore">The nonce store.</param> + internal static void RecordFeatureAndDependencyUse(object value, ServiceProviderDescription service, ITokenManager tokenManager, INonceStore nonceStore) { + Contract.Requires<ArgumentNullException>(value != null); + Contract.Requires<ArgumentNullException>(service != null); + Contract.Requires<ArgumentNullException>(tokenManager != null); + + if (Enabled) { + StringBuilder builder = new StringBuilder(); + builder.Append(value.GetType().Name); + builder.Append(" "); + builder.Append(tokenManager.GetType().Name); + if (nonceStore != null) { + builder.Append(" "); + builder.Append(nonceStore.GetType().Name); + } + builder.Append(" "); + builder.Append(service.Version); + builder.Append(" "); + builder.Append(service.UserAuthorizationEndpoint); + observedFeatures.Add(builder.ToString()); + Touch(); + } + } + + /// <summary> /// Records statistics collected from incoming requests. /// </summary> /// <param name="request">The request.</param> @@ -351,7 +384,7 @@ namespace DotNetOpenAuth { } /// <summary> - /// Gets or sets the name of the file. + /// Gets the name of the file. /// </summary> /// <value>The name of the file.</value> internal string FileName { get; private set; } |