Comments (3)
Hi,
yes, I didn't have the time yet to rework the docs (up until a few days ago I was mostly into refactoring only as I forked the library only very recently). I would assume you're using the nuget version are you, and not this latest dev version?
For the NuGet version (2.0.2), this is essentially how I do it currently in the project where I use the library (I have this scattered through a few wrapper functions of course, but this part of the code is relevant to you):
var influxDbClient = new InfluxDb(_influxDbUri, _influxDbUserName, _influxDbPassword, InfluxVersion.v095);
var point = BuildReadingPoint(someReadingDto);
var points = someReadingsDtoList.Select(p => BuildReadingPoint(p));
// in 2.0.2 there are two overloads for writing data, so you can use whatever you need
var pointResult = await influxDbClient.WriteAsync("SomeDbName", point);
var pointsResult = await influxDbClient.WriteAsync("SomeDbName", points);
Where BuildReadingPoint
is something like this:
public Point BuildReadingPoint(ReadingMessageDTO dto)
{
return new Point()
{
Name = "reading",
Tags = new Dictionary<string, object>()
{
{ "SensorId", dto.SensorId },
{ "SerialNumber", dto.SerialNumber }
},
Fields = new Dictionary<string, object>()
{
{ "RawMessage", dto.RawMessage },
{ "Humidity", dto.Humidity },
{ "Temperature", dto.Temperature },
{ "Resistance", dto.Resistance }
},
Timestamp = dto.DateCreated
};
}
I'll most probably update the library this weekend (it will have a few small breaking changes, but nothing much, should be very easy to update). And then I'll also prepare the docs to go with that as well.
Let me know if that worked for you, and if you need any additional help, feel free to ask. :)
from influxdata.net.
Great, thanks! I'm using it with the points method and it works really well. I'll be posting a video soon showing a cool store/forward feature I have in my app I'm building. May be something you would want to build into the library. I think you could make a solid debate either way though.
from influxdata.net.
No problem, I'm glad it works well. :)
Sure, when it's ready, open a new issue and explain what you mean by this, you can link your video also. Perhaps provide a short code sample of what you would like it to do as well.
from influxdata.net.
Related Issues (20)
- Has this client been tested on downlevel revisions of .NET framework? HOT 3
- " in string fields are not working HOT 3
- GetSeries fails on measurements containing a dot HOT 4
- Select query somtimes returns "BadRequest" HOT 1
- receiving error on writing HOT 2
- silently hanging HOT 5
- System.Net.Http wrong version. HOT 7
- [Question] WriteAsync default behaviour HOT 7
- BatchWriter flushing? HOT 3
- suport time precision of nano-second HOT 4
- Strong naming HOT 6
- Adding a float whole number into InfluxData.Net as field throws exception assuming it is an integer. HOT 1
- Why not support .net 4.5.2 ? HOT 3
- Use UTC DateTimes
- gzip compression HOT 2
- Need Help: Unable to read data from the transport connection: The connection was closed.
- HTTP errors are handled inconsistently HOT 1
- Is InfluxData.Net still being maintained? HOT 6
- dll version is not suitable, and no strong name
- Support convert enum type value in InfluxData.Net.InfluxDb.Helpers.SerieExtensions.As<T>
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from influxdata.net.