pyvmomi perfManager - Get all stats - pyvmomi

While a am a noob in python and pyvmomi, thru the help of stackoverflow and the pyvmomi sample I have been able to get most of the information I need from ESXi servers. I want to get all the stats at the lowest level they are keeped from perfManager. All the examples I seen deal with aggregating them over a time frame.
What I think I want to do is call query = vim.PerformanceManager.QuerySpec(maxSample=1,entity=host,metricId=[metricId],startTime=startTime,endTime=endTime)
with startTime and endTime as NULL or is python None?
and then iterate thru what comes back
I want to save the vm, datetime of the stat, the metricId and the value.
Also is there a wild card for metricId that would give me all the meticId's or do I need to call once for each metric?
I also beleve if I was to call it again later with the last datetime as the startTime and endTime as null I should get all the new stats since the last set I save? Is this correct?

After much much searching I found this which had the few missing details.
https://github.com/dograga/ESXPerfData/blob/master/vmperfcollection_threaded.py

Related

Is it possible to get the price of bitcoin in USD from the coinbase API for a specific time in the past?

GET https://api.coinbase.com/v2/prices/:currency_pair/spot
This price seems to be the current price
This question already has answers. Copy and pasted from here: Coinbase API v2 Getting Historic Price for Multiple Days
Any reason you aren't using coinbase pro?
The new api is very easy to use. Simply add the get command you want followed by the parameters separated with a question mark. Here is the new historic rates api documentation: https://docs.pro.coinbase.com/#get-historic-rates
The get command with the new api most similar to prices is "candles". It requires three parameters to be identified, start and stop time in iso format and granularity which is in seconds. Here is an example:
https://api.pro.coinbase.com/products/BTC-USD/candles?start=2018-07-10T12:00:00&stop=2018-07-15T12:00:00&granularity=900
EDIT: also, note the time zone is not for your time zone, I believe its GMT.

how to get hourly calculation based on earliest pickup time and earliest stoptime

how to get the hourly calculation according to the earliest start time and earliest stop time.
the condition is if the driver has the same name of drop address. the hourly calculation will show for all. The 0.00hrs should apply to all riders with the same drop address regardless of how many in the same ride. I attached a screenshot and which type of output I needed it's shown in highlighted areas.
enter image description here
Use DATEDIFF function to calculate the number of minutes or seconds between start and end times and divide it by 60 or 3600 to get the hours.
Why using XPathSelectElements in c# try give me some example. and try to give me Xdocument all method what is the work and some example?
After creating date first approach Entity framework how to add table columns, a procedure from an existing database in ENTITY Fream work

salesforce getUpdated method result

i am using salesforce soap api and user getUpdated() method for retrieving updated data but it gives data which is not in timestamp which i gives in method.
$startDate = "2013-09-04 20:51:36"; and
$endDate = "2013-09-05 20:51:36";
Result is
$result = getUpdated("contact", strtotime($startDate), strtotime($endDate)));
but $result also contain data which is having lastModifiedDate="2013-08-19 02:50:00";
what is the reason for this?
there is any mistake in startdate and enddate?
or there is some another way to do this?
The start & end dates are rounded off to minutes (IIRC, down for start & up for end), so the actual date range is slightly larger than the one you specified in this case.
Presumably there's also some TZ offseting going on, which can also account for some of the difference your're seeing (the date/times in the SOAP message typically have the TZ offset in them, so seeing the actual raw dates going back and forth would also help you).

strange appengine query result

What am I doing wrong in this query?
SELECT * FROM TreatmentPlanDetails
WHERE
accountId = 'ag5zfmRvbW9kZW50d2ViMnIRCxIIQWNjb3VudHMYtcjdAQw' AND
status = 'done' AND
category = 'chirurgia orale' AND
setDoneCalendarEventStartTimestamp >= [timestamp for 6 june 2012] AND
setDoneCalendarEventStartTimestamp <= [timestamp for 11 june 2012] AND
deleteStatus = 'notDeleted'
ORDER BY setDoneCalendarEventStartTimestamp ASC
I am not getting any record and I am sure there are records meeting the where clause conditions. To get the correct records I have to widen the timestamp interval by 1 millisecond. Is it normal? Furthermore, if I modify this query by removing the category filter, I am getting the correct results. This is definitely weird.
I also asked on google groups, but I got no answer. Anyway, for details:
https://groups.google.com/forum/?fromgroups#!searchin/google-appengine/query/google-appengine/ixPIvmhCS3g/d4OP91yTkrEJ
Let's talk specifically about creating timestamps to go into the query. What code are you using to create the timestamp record? Apparently that's important, because fuzzing with it a little bit affects the query. It may be relevant that in the datastore, timestamps are recorded as integers representing posix timestamps with microseconds, i.e. the number of microseconds since 1/1/1970 UTC (not counting leap seconds). It's also relevant that dates (i.e. without a time) are represented as midnight, i.e. the earliest time on that day. But please show us the exact code. (It may also be important to show the actual content of the record that you're attempting to retrieve.)
An aside that is not specific to your question: Entity property names count as part of your storage quota. If this is going to be a huge dataset, you might pay more $$ than you'd like for property names like setDoneCalendarEventStartTimestamp.
Because you write :
if I modify this query by removing the category filter, I am getting
the correct results
this probably means that the category was not indexed at the time you write the matching records to the data store. You have to re-write your records to the data store if you want them added to the newly created index.

Magento - get list of items from orders for specific date range

Magento database name convention is not trivial. How to get these fields below for last 7 days?
Last Name
First Name
Address
City
State
Zip
Phone
Email
Amount
Order #
Item #
I could not tell if you were looking for some PHP/Magento code or if you are looking to access the database directly. It might be "better" to create yourself a custom module that fetches this info using the Magento/Zend framework, but since I don't know the code off the top of my head I'll redirect you to the following link which has a very nice SQL query that will pull that info for you (and more).
http://www.magentocommerce.com/wiki/groups/207/fedex_-_shipping_view
You probably just need to add something like this to the end to filter the last 7 days
where so.created_at > NOW() - INTERVAL 7 DAY

Resources