Tag counts from gateway status page

I just wrote a script utilising the tag report function to summarise the tags at a site, and am seeing significant differences between the numbers produced by the reporting tool and by the numbers in the "realtime providers" on the gateway status webpage.

Tag report function:

Tag summary
========================
total: 453767
tagType: {'UdtInstance': 33115, 'Folder': 29136, 'AtomicTag': 391516}
valueSource: {'memory': 59501, 'opc': 265960, 'reference': 24, 'expr': 66003, 'derived': 22, 'db': 6}
dataType: {'Int1': 1123, 'Float4': 52706, 'Int2': 735, 'DataSet': 6144, 'Float8': 8006, 'Int4': 45024, 'String': 77518, 'Int8': 21097, 'Document': 19, 'DateTime': 231, 'Boolean': 178913}
eventScripts: 3035
historyEnabled: 38924

Gateway status "Realtime Providers" page:
image

The start of my code is this:

provider = 'default_fixed'
# list of tag properties to include in the summary. Must be valid tag properties
tag_summary_properties = ['tagType', 'valueSource', 'dataType', 'tagGroup', 'eventScripts', 'historyEnabled']
query = {
	"options": {
		"includeUdtMembers": True,
		"includeUdtDefinitions": False
	},
	"condition": {
		"attributes": {
			"values": [],
			"requireAll": True
		}
	},
	"returnProperties": tag_summary_properties
}

print 'Tag summary'
print '========================'
tags = system.tag.query(provider, query)
print 'total:', len(tags)

Edit: Nevermind... it must be the UDT definitions that I'm excluding

Edit2: No, including UDT definitions, I get this:

Tag summary
========================
total: 499151
tagType: {'UdtInstance': 35026, 'Folder': 31764, 'AtomicTag': 431452, 'UdtType': 909}
valueSource: {'memory': 68593, 'opc': 290888, 'expression': 1, 'reference': 35, 'expr': 71907, 'derived': 22, 'db': 6}
dataType: {'Int1': 1526, 'Float4': 59281, 'Int2': 1504, 'DataSet': 6572, 'Float8': 9085, 'Int2Array': 2, 'Int4': 49797, 'Int1Array': 47, 'Int4Array': 21, 'String': 83295, 'Int8': 22693, 'Document': 33, 'DateTime': 292, 'Float4Array': 5, 'Boolean': 197299}
eventScripts: 3238
historyEnabled: 41784

That leaves 6,520 tags unaccounted for :thinking:

I believe the gateway status will also include any tags that are r/w to with scripting that are not defined as a tag in your providers.