Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(1)  |  Call(1)  |  Derive(0)  |  Import(0)
Sent after a successful build of a pebble app to record the sizes of
the resources

Parameters:
--------------------------------------------------------
uuid: application's uuid
resCounts: a dict containing the number of resources of each type
                i.e. {"image": 4, "font": 2, "raw": 1}
resSizes: a dict containing the size of resources of each type
                i.e. {"image": 490, "font": 200, "raw": 100}    

        def res_sizes_evt(uuid, resCounts, resSizes):
    """ Sent after a successful build of a pebble app to record the sizes of
    the resources
    
    Parameters:
    --------------------------------------------------------
    uuid: application's uuid
    resCounts: a dict containing the number of resources of each type
                    i.e. {"image": 4, "font": 2, "raw": 1}
    resSizes: a dict containing the size of resources of each type
                    i.e. {"image": 490, "font": 200, "raw": 100}    
    """
    totalSize = sum(resSizes.values())
    totalCount = sum(resCounts.values())
    _Analytics.get().post_event(category='appResources', action='totalSize', 
               label=uuid, value = totalSize)
    _Analytics.get().post_event(category='appResources', action='totalCount', 
               label=uuid, value = totalCount)
    
    for key in resSizes.keys():
        _Analytics.get().post_event(category='appResources', 
                action='%sSize' % (key), label=uuid, value = resSizes[key])
        _Analytics.get().post_event(category='appResources', 
                action='%sCount' % (key), label=uuid, value = resCounts[key])
        


src/l/i/libpebble-HEAD/pebble/PblBuildCommand.py   libpebble(Download)
 
        # Send the stats now
        PblAnalytics.res_sizes_evt(uuid=appInfo["uuid"],
                                 resCounts = resCounts,
                                 resSizes = resSizes)