Skip to main content
1-Visitor
Nov 23, 2016 2:01 PM UTC
Question

Why doesn't maxItems (the parameter of QueryPropertyHistory) work properly?

Intuitively, if you set maxItems to 10, then you only expect up to 10 rows back from the service.  In my experience, the number of rows returned is about four times whatever I set maxItems to.  In a simple empirical test, I tried a variety of values of maxItems for the same timeframe, and here's what I got back:

                                                                                                                                                                               

maxItemsRows returned
14
28
312
416
519
622
725

Furthermore, I would expect as I increase maxItems, I would simply get additional rows with a later time; this too is not what happens.  I always get new rows with each increase of maxItems, but they aren't all later in time!  I've summarised this below:

timestampFirst value of maxItems where timestamp is seen
2016-11-23 01:00:00.2241
2016-11-23 01:00:00.2261
2016-11-23 01:00:00.2311
2016-11-23 01:01:00.1802
2016-11-23 01:01:00.1822
2016-11-23 01:01:00.1841
2016-11-23 01:01:00.1862
2016-11-23 01:02:00.2243
2016-11-23 01:02:00.2273
2016-11-23 01:02:00.2303
2016-11-23 01:03:00.1614
2016-11-23 01:03:00.1644
2016-11-23 01:03:00.1684
2016-11-23 01:04:00.1735
2016-11-23 01:04:00.1755
2016-11-23 01:04:00.1795
2016-11-23 01:05:00.1326
2016-11-23 01:05:00.1356
2016-11-23 01:05:00.1386
2016-11-23 01:06:00.1307
2016-11-23 01:06:00.1327
2016-11-23 01:06:00.1357
2016-11-23 01:09:00.1362
2016-11-23 01:16:00.2203
2016-11-23 01:24:00.1574

Unless I'm missing something fundamental, maxItems really doesn't work properly!

PS - I've seen a post by Pat Nash related to this, but it doesn't address exactly what's going on with maxItems!

15 replies

5-Regular Member
Nov 29, 2016 9:12 PM UTC

What version of ThingWorx are you in?

Translate
rwiseman1-VisitorAuthor
1-Visitor
Nov 30, 2016 8:55 AM UTC

I'm using ThingWorx 7.0.4-b44.

Translate
5-Regular Member
Nov 30, 2016 7:13 PM UTC

I just tested this in 7.2.4, and there were no issues with either streams or value streams. Perhaps if this was a bug, it is already fixed in newer versions.

Translate