Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3782088
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T11:02:02+00:00 2026-05-19T11:02:02+00:00

Scenario: I am tracking several performance counters and have a CounterDescription[] correlate to DataSnapshot[]…

  • 0

Scenario: I am tracking several performance counters and have a CounterDescription[] correlate to DataSnapshot[]… where CounterDescription[n] describes the data loaded within DataSnapshot[n].

I want to expose an easy to use API within C# that will allow for the easy and efficient expansion of the arrays.

Simplified example (it gets more complex)

CounterDescription[0] = Humidity;
DataSnapshot[0] = .9;
CounterDescription[1] = Temp;
DataSnapshot[1] = 63;

Note how my intent is to correlate many Datasnapshots with a DateTime reference, and using the offset of the data to refer to its meaning. This was determined to be the most efficient way to store the data on the back-end, and has now reflected itself into the following structure:

  public class myDataObject { 
    [DataMember]
    public SortedDictionary<DateTime, float[]> Pages { get; set; }

    /// <summary>
    /// An array that identifies what each position in the array is supposed to be
    /// </summary>
    [DataMember]
    public CounterDescription[] Counters { get; set; }
   }

How will myDataObject be used?:

I will frequently search for a counter by string name, and use its’ position to determine what offset a particular value will be saved. I can use an homegrown extension method to enumerate the object, or leverage the framework if ordering is guaranteed.

Also, I will need to expand each of these arrays as new sensors are added: (float[] and CounterDescription[] ), but whatever data already exists must stay in that relative offset. I don’t want the serialized version of this object to confuse Temp (offset 1) with Humidity (offset 0)

Which .NET objects support this fixed ordering, expansion, and enumeration (and optional searching by string)? My guess is to use one of these objects…

Array[] , LinkedList<t>, and List<t>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T11:02:02+00:00Added an answer on May 19, 2026 at 11:02 am

    Use a Dictionary<string, double> so that each name (string) maps to a value (double):

    var counters = new Dictionary<string, double>();
    
    counters["Humidity"] = 0.9;
    counters["Temp"] = 63;
    

    And use a service that gets and sets the counter values:

    [OperationContract]
    public double GetCounter(string name)
    {
         return Counters[name];
    }
    
    [OperationContract]
    public void SetCounter(string name, double value)
    {
         Counters[name] = value;
    }
    

    You can use your CounterDescription and/or DataSnapshot classes in the same way, but make sure that the class you use as the key (probably CounterDescription) overrides Object.Equals() and Object.GetHashCode() with a proper implementation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Take this scenario. I have a Google Analytics tracking code, and I only want
Scenario: I want to have an enum containing all the playing cards in a
Scenario: You have an ASP.Net webpage that should display the next image in a
Scenario I have two wrappers around Microsoft Office, one for 2003 and one for
Scenario: Let's say I have four very similar applications (i.e. most of the functionality
Scenario You've got several bug reports all showing the same problem. They're all cryptic
Scenario: Let's say I have two tables, TableA and TableB. TableB's primary key is
I have a scenario where I need to check if rows in a target
I have some mouse-tracking code that isn't working as expected in IE that basically
Hi I was wondering if this is possible, this is my scenario, I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.